RE: Check constraint failure messages

Поиск
Список
Период
Сортировка
От Kevin Brannen
Тема RE: Check constraint failure messages
Дата
Msg-id SN6PR19MB23514B8E9B8869021CC861C6A4749@SN6PR19MB2351.namprd19.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Check constraint failure messages  (Miles Elam <miles.elam@productops.com>)
Список pgsql-general

From: Miles Elam <miles.elam@productops.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.

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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Primary keys and composite unique keys(basic question)
Следующее
От: Miles Elam
Дата:
Сообщение: Re: Check constraint failure messages