Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-23 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > I think pg_dump should add the check constraints in the same manner as > it does triggers. > Bruce, do we have a TODO item for this? No, because that idea has been proposed and rejected before --- it adds overhead (extra table scans) and reduces readability

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-23 Thread Jan Wieck
Added pgsql-hackers Added Bruce Momjian On 6/23/2005 12:19 PM, Michael Fuhr wrote: The question I have is how exactly you manage to get the trigger fired when restoring the dump. By default, the dump created by pg_dump will create the table, fill in the data and create the trigger(s) only afte

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-23 Thread Michael Fuhr
On Thu, Jun 23, 2005 at 11:47:37AM -0400, Jan Wieck wrote: > On 6/20/2005 1:23 PM, Lee Harr wrote: > > > >You ask some great questions. Thanks. > > But not the really important one :-) Maybe that's because it didn't need asking :-) > The question I have is how exactly you manage to get the trigg

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-23 Thread Jan Wieck
On 6/20/2005 1:23 PM, Lee Harr wrote: Some of the data required by the check function is being restored after the data being checked by the function and so it all fails the constraint. Are you saying that the check function perform queries against other data? That might not be a good idea --

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-20 Thread Lee Harr
Some of the data required by the check function is being restored after the data being checked by the function and so it all fails the constraint. Are you saying that the check function perform queries against other data? That might not be a good idea -- consider what happens if the data change

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-20 Thread Michael Fuhr
On Mon, Jun 20, 2005 at 08:18:00AM -0400, John Burger wrote: > > I don't have personal experience with this, but I thought it was fairly > common to DEFER constraint checking until after a restore completed, > for exactly this reason. Regarding DEFERRABLE, according to the CREATE TABLE documenta

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-20 Thread John Burger
I don't have personal experience with this, but I thought it was fairly common to DEFER constraint checking until after a restore completed, for exactly this reason. - John Burger MITRE ---(end of broadcast)--- TIP 9: the planner will ignore

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-19 Thread Michael Fuhr
On Mon, Jun 20, 2005 at 05:49:05AM +0430, Lee Harr wrote: > > I have a database running 8.0.1 > > One of the tables uses a plpgsql function as a > check constraint. There is data in the table that > passed the constraint. > > The problem comes when trying to restore the > database using a file cr