Re: REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED
Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
From: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Peter Geoghegan <peter.geoghegan86@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Dimitri Fontaine <dimitri@2ndquadrant.fr>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2011-01-23T18:33:41Z
Lists: pgsql-hackers
On 1/23/2011 8:23 PM, Simon Riggs wrote: > On Sun, 2011-01-23 at 19:50 +0200, Marko Tiikkaja wrote: >> Another problem I found is that psql doesn't indicate in any way that a >> FOREIGN KEY constraint is not validated yet. > > Should it? > What command do you think needs changing? \d table now only shows that there's a FOREIGN KEY, which might lead the user to think that there should not be any values that don't exist in the referenced table. >> I also think that having the function for getting a list of values that >> violate the constraint would be helpful. Any particular reason why you >> decided to omit it from this patch? > > Yes, the consensus was that DDL was required, not a function. Function > was my preferred approach originally. While I do agree that the DDL command should be the preferred way to validate the constraint, I think the function adds a significant value when the validation does not succeed. > That now appears to be an additional request from a couple of people. At > present, its easy enough to write the SQL statement yourself, so that's > non-essential, and maybe/likely won't make this release (not sure, > depends upon how other aspects go). I understand. > There is no option to invoke this yet from pg_restore, which seems > likely to top the list of priorities. Would you agree? I don't understand what you mean with this. Could you be a bit more elaborate? Regards, Marko Tiikkaja