[HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Marko Tiikkaja
Hi Simon, On 1/14/2011 1:15 PM, Simon Riggs wrote: Patch to implement the proposed feature attached, for CFJan2011. Overall, I think the patch looks good, but I found some problems with it. In tablecmds.c you have: + if (found con-contype == CONSTR_FOREIGN !con-convalidated)

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Simon Riggs
On Sun, 2011-01-23 at 19:50 +0200, Marko Tiikkaja wrote: Hi Simon, On 1/14/2011 1:15 PM, Simon Riggs wrote: Patch to implement the proposed feature attached, for CFJan2011. Overall, I think the patch looks good Thanks for the review. , but I found some problems with it. In

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Marko Tiikkaja
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

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Simon Riggs
On Sun, 2011-01-23 at 20:33 +0200, Marko Tiikkaja wrote: 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?

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Marko Tiikkaja
On 1/23/2011 8:43 PM, Simon Riggs wrote: On Sun, 2011-01-23 at 20:33 +0200, Marko Tiikkaja wrote: 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

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Simon Riggs
On Sun, 2011-01-23 at 20:56 +0200, Marko Tiikkaja wrote: On 1/23/2011 8:43 PM, Simon Riggs wrote: On Sun, 2011-01-23 at 20:33 +0200, Marko Tiikkaja wrote: 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

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On Sun, 2011-01-23 at 20:33 +0200, Marko Tiikkaja wrote: \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. Neither \d nor \di shows

Re: [HACKERS] REVIEW: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-01-23 Thread Simon Riggs
On Sun, 2011-01-23 at 14:45 -0500, Tom Lane wrote: Simon Riggs si...@2ndquadrant.com writes: On Sun, 2011-01-23 at 20:33 +0200, Marko Tiikkaja wrote: \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