Re: Using the database to validate data

Поиск
Список
Период
Сортировка
От JPLapham
Тема Re: Using the database to validate data
Дата
Msg-id 1437690895129-5859160.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Using the database to validate data  (Tim Clarke <tim.clarke@manifest.co.uk>)
Ответы Re: Using the database to validate data  (rob stone <floriparob@gmail.com>)
Список pgsql-general
Tim Clarke wrote
> Shouldn't be too difficult to import those new rows into one table,
> write a procedure that inserts them into the real table one by one and
> logs the validation failure if any - committing good rows and rolling
> back bad. In fact if you could then write the failures to a third table
> with a completely relaxed (or no) validation?

Tim-

Thanks for your response. Yes, you are right, it shouldn't be too difficult,
and in fact I have already implemented basically what you suggest, see "Idea
2" from my original message.

The problem with this approach is that it fails to find violations such as
UNIQUE (there are probably others) from within the input data until after
the first has been committed to the database. But, the error may have been
with that earlier row, not the later.

I want my users to fix all the problems with their data and then load it in
an "all or none" fashion.

-Jon

--
Sent via pgsql-general mailing list (pgsql-general@)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




--
View this message in context: http://postgresql.nabble.com/Using-the-database-to-validate-data-tp5859046p5859160.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: Jon Lapham
Дата:
Сообщение: Re: Using the database to validate data
Следующее
От: rob stone
Дата:
Сообщение: Re: Using the database to validate data