Re: Check Constraints and pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jonathan Scott <jwscott(at)vanten(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Check Constraints and pg_dump
Date: 2004-02-26 13:54:59
Message-ID: 11619.1077803699@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jonathan Scott <jwscott(at)vanten(dot)com> writes:
> The functions and tables create just fine, but when it gets to the
> COPY part of the sql script, it tries to load tables in what really is
> the wrong order. The check constraint is making sure there is a "plan"
> before there is a "contract", yet pg_dump is trying to load the
> contract table before there is anything in the plan table.

Shouldn't you be using a foreign key for that?

I don't see any reasonable way that pg_dump can be expected to
understand that a check constraint expresses a relationship between two
tables. The semantics of check constraints aren't right for it anyway.

All else being equal, I think the tables will be loaded in OID order,
so a possible workaround is to create the plan table first. But an
FK seems like a better answer.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-26 14:16:03 Re: ORDER BY different locales
Previous Message Karel Zak 2004-02-26 13:35:33 ORDER BY different locales