Re: getting all constraint violations

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: getting all constraint violations
Date: 2010-05-21 18:46:12
Message-ID: 482E80323A35A54498B8B70FF2B879800458B8875B@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there a way to temporarily suspend constraint checking for a particular constraint inside of the transaction, try the insert again, capture the next violation, then the next, etc... then rollback after all have been collected?

-dave

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Friday, May 21, 2010 1:36 PM
To: Gauthier, Dave
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] getting all constraint violations

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> I have a table with many constraints. A user tries to insert a record that violates many of them. The error message I get back lists the first violation. How cani I (or can I) get them all?

You can't, it stops running the command at the first error.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2010-05-21 18:55:10 Re: Is postgres installed?
Previous Message Tom Lane 2010-05-21 18:16:53 Re: Select max(primary_key) taking a long time