Re: Constraints & pg_dump - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: Constraints & pg_dump
Date
Msg-id 200403162319.49467.josh@agliodbs.com
Whole thread Raw
In response to Re: Constraints & pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Constraints & pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom,

> Isn't this already solved by dumping in dependency order?
>
>             regards, tom lane

Nope.   Problem is, the table depends on the function, and the function 
depends on the table.   pg_dump (in 7.4.1, at least) will dump the table 
first, *with the constraint*, and then the function ... causing table 
creation to fail.

And this isn't come cross-table function either; the constraint that they're 
implementing is partial uniqueness, which is appropriate for a constraint.  

I personally think that the simplest way to do this ... and deal with most 
custom-function-constraint issues ... is to push all constraints containing a 
user-defined  function to the end of the file with the foriegn keys.

(this is for the Bricolage project)

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-hackers by date:

Previous
From: "Jonathan M. Gardner"
Date:
Subject: Re: Doxygen?
Next
From: Tom Lane
Date:
Subject: Re: Constraints & pg_dump