Re: [BUGS] Problem identifying constraints which should not be inherited

2008-04-02 Thread NikhilS
Hi Alvaro On Fri, Mar 28, 2008 at 6:05 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > NikhilS escribió: > > > I will take a look at the pg_dump related changes if you want. We will > need > > changes in flagInhAttrs() and in getTableAttrs() to query the backend > for > > these 2 attributes for p

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-28 Thread Alex Hunsaker
On Fri, Mar 28, 2008 at 4:07 AM, NikhilS <[EMAIL PROTECTED]> wrote: > Hi Alex, > > > On Fri, Mar 28, 2008 at 4:58 AM, Alex Hunsaker <[EMAIL PROTECTED]> wrote: > > Attached is a WIP patch I have been playing with in my spare time. It > > should take care of the first 2. It does nothing for pg_dump

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-28 Thread Alvaro Herrera
NikhilS escribió: > P.S Alvaro, I think this patch did not reach the mailing list and was > stalled due to size restrictions or something. OK, it's archived now: http://archives.postgresql.org/pgsql-patches/2008-03/msg00392.php Thanks. -- Alvaro Herrerahttp://www

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-28 Thread Alvaro Herrera
NikhilS escribió: > P.S Alvaro, I think this patch did not reach the mailing list and was > stalled due to size restrictions or something. Argh, you are right. We don't have this on the archives anywhere :-( Probably it got stuck on Maia ... -- Alvaro Herrerahtt

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-28 Thread NikhilS
Hi Alex, On Fri, Mar 28, 2008 at 4:58 AM, Alex Hunsaker <[EMAIL PROTECTED]> wrote: > On Thu, Mar 27, 2008 at 5:14 AM, NikhilS <[EMAIL PROTECTED]> wrote: > > * Add logic to disallow ADD CONSTRAINT ONLY to parent of an inheritance > > hierarchy > > > > * Add logic to mark inherited constraints in t

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-27 Thread Tom Lane
NikhilS <[EMAIL PROTECTED]> writes: > ... > * Add logic to mark inherited constraints in the children: > This can be achieved by introducing a new bool "coninherited" attribute in > pg_constraint. This will be set to true on only those check constraints that > are added to children via the inherita

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-27 Thread Heikki Linnakangas
NikhilS wrote: Am important decision here is about adding a new attribute to pg_constraint as it is the only sane way of determining inherited constraints, but that will require an initdb. Comments? There's no problem forcing an initdb at this point in the release cycle. We will do that for su

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-27 Thread NikhilS
Hi, On Thu, Mar 20, 2008 at 7:36 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > More to the point, it takes a capability away from the user without > actually solving the problem we need to solve, namely to guarantee > consistency between parent and child constraints. You can be sure > that there i

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-20 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > NikhilS escribió: >> Ok, I understand. But even then this could patch could be considered even if >> it does not solve the TODO completely, no? It atleast disallows ONLY ADD >> CONSTRAINT on the parent. > No, because you would then feel that the TODO it

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-20 Thread NikhilS
Hi, On Thu, Mar 20, 2008 at 6:11 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > NikhilS escribió: > > > On Wed, Mar 19, 2008 at 8:23 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > > > If it's a small patch, it's wrong by definition. AFAICS there is no > way > > > to fix this correctly that doesn't

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-20 Thread Alvaro Herrera
NikhilS escribió: > On Wed, Mar 19, 2008 at 8:23 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > If it's a small patch, it's wrong by definition. AFAICS there is no way > > to fix this correctly that doesn't involve catalog changes. The point > > of the TODO is that you have to enforce that the inh

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-19 Thread NikhilS
Hi, On Wed, Mar 19, 2008 at 8:23 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > NikhilS <[EMAIL PROTECTED]> writes: > > On Fri, Mar 7, 2008 at 6:37 AM, Bruce Momjian <[EMAIL PROTECTED]> wrote: > >> Added to TODO: > >> o Require all CHECK constraints to be inherited > > > PFA, a small patch attached wh

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-19 Thread Tom Lane
NikhilS <[EMAIL PROTECTED]> writes: > On Fri, Mar 7, 2008 at 6:37 AM, Bruce Momjian <[EMAIL PROTECTED]> wrote: >> Added to TODO: >> o Require all CHECK constraints to be inherited > PFA, a small patch attached which should fix this. If it's a small patch, it's wrong by definition. AFAICS there i

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-19 Thread NikhilS
Hi, On Fri, Mar 7, 2008 at 6:37 AM, Bruce Momjian <[EMAIL PROTECTED]> wrote: > > Added to TODO: > > > o Require all CHECK constraints to be inherited > > > > http://archives.postgresql.org/pgsql-bugs/2007-04/msg00026.php > > PFA, a small patch attached which should fix this. I have

Re: [BUGS] Problem identifying constraints which should not be inherited

2008-03-06 Thread Bruce Momjian
Added to TODO: > o Require all CHECK constraints to be inherited > > http://archives.postgresql.org/pgsql-bugs/2007-04/msg00026.php --- Tom Lane wrote: > "Chris Fischer" <[EMAIL PROTECTED]> writes: > > alter

Re: [BUGS] Problem identifying constraints which should not be inherited

2007-04-12 Thread Tom Lane
"Chris Fischer" <[EMAIL PROTECTED]> writes: > alter table only t1 add constraint ck_col1 check (number <> 0); The bug here is that we allow that. Continuing your example, regression=# insert into t2 values(0); INSERT 0 1 regression=# select * from t1; col1 -- 0 (1 row) which sure looks

[BUGS] Problem identifying constraints which should not be inherited

2007-04-12 Thread Chris Fischer
There's no way in the pg_ tables to identify when a check constraint on an inherited table should not be inherited. Example: create table t1 (col1 number(10)); create table t2 () inherits t2; alter table only t1 add constraint ck_col1 check (number <> 0); Now, run pg_dump and notice that t