Search Postgresql Archives

Re: Possible to prevent transaction abort?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux