RE: Check constraint failure messages

From: Kevin Brannen <KBrannen(at)efji(dot)com>
To: Miles Elam <miles(dot)elam(at)productops(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: Check constraint failure messages
Date: 2021-04-08 20:32:19
Message-ID: SN6PR19MB23514B8E9B8869021CC861C6A4749@SN6PR19MB2351.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: Miles Elam <miles(dot)elam(at)productops(dot)com>
Sent: Tuesday, April 6, 2021 4:19 PM

Sadly, this is a cloud-managed database without direct access to 5432 from outside the VPC and bastian instances are frowned upon by our security folks. Guess I'm stuck with bisecting. Thanks for the confirmation.

====================

It'd slow you down a little, but you could install a before trigger to do the check and if it fails you'll have all the info you need and can call RAISE to communicate a record identifier, bad value, whatever.

If performance is really a big deal, set up the trigger only after you get a failure so you only have to run it on the 'bad batches'.

Or else write a precheck program that looks at the data first and looks only for this and therefore can report the exact record before it feeds the good data to your real loader.

Or there's probably other ways I'm not thinking of. The question is what options does your process allow, I suppose.

HTH,
Kevin
.
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Miles Elam 2021-04-09 00:20:10 Re: Check constraint failure messages
Previous Message Bryn Llewellyn 2021-04-08 18:17:18 Re: Have I found an interval arithmetic bug?