Re: Possible to prevent transaction abort?

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Possible to prevent transaction abort?
Дата
Msg-id 49FBBB92.1050000@postnewspapers.com.au
обсуждение исходный текст
Ответ на Possible to prevent transaction abort?  (Adam B <adamb@videx.com>)
Список pgsql-general
Adam B wrote:
> Hello all,
>
> Is it possible to prevent Postgre from aborting the transaction upon a
> constraint violation?

Not without use of savepoints.

What I like to do is bulk-insert the suspect data into a temp table
without constraints, then INSERT INTO ... SELECT it into the target
table with appropriate WHERE constraints to prevent attempts to insert
invalid values.

Another alternative is to constrain each INSERT statement with an
appropriate WHERE clause after rephrasing it in INSERT INTO ... SELECT
form .

--
Craig Ringer

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: recover corrupt DB?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: recover corrupt DB?