pg_restore order and check constraints

From: Moshe Jacobson <moshe(at)neadwerx(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: pg_restore order and check constraints
Date: 2013-06-23 16:34:50
Message-ID: CAJ4CxLnapEfVNOJMNCXCg7Sf-Po=7y5=5bf2BkLqhSt1aTfEVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I recently added a check constraint onto a table in my database, that uses
a stored procedure to check one of the inserted columns against the data of
another table.

I know that this is stretching the limit of what a check constraint is
meant to be, but is there a way, short of editing the pg_restore list
manually every time, to guarantee that the table used for validation is
populated before the table with the data being validated?

Right now it is restoring out of order, and the table is not getting
populated correctly.

if I have to rewrite as a trigger, I will do that, but I like the check
constraint because it checks all of the entries when it's applied. Any
suggestions?

--
Moshe Jacobson
Nead Werx, Inc. | Manager of Systems Engineering
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe(at)neadwerx(dot)com | www.neadwerx.com

"Quality is not an act, it is a habit." -- Aristotle

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-06-23 16:51:06 Re: I want to make an example of using parameterized path
Previous Message Adrian Klaver 2013-06-23 14:35:10 Re: File System backup