Skip site navigation (1) Skip section navigation (2)

Re: [badalex@gmail.com: Re: [BUGS] Problem identifying constraints which should not be inherited]

From: NikhilS <nikkhils(at)gmail(dot)com>
To: "Pg Patches" <pgsql-patches(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Alex Hunsaker" <badalex(at)gmail(dot)com>
Subject: Re: [badalex@gmail.com: Re: [BUGS] Problem identifying constraints which should not be inherited]
Date: 2008-04-01 08:40:02
Message-ID: d3c4af540804010140j1a82072dpcaa4293196377984@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Hi,

On Tue, Apr 1, 2008 at 7:33 AM, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:

> > I was taking a look at this patch to add the pg_dump related changes.
> Just
> > wanted to give you a heads up as this patch crashes if we run "make
> > installcheck". Seems there is an issue introduced in the CREATE TABLE
> > REFERENCES code path due to your patch (this is without my pg_dump
> changes
> > just to be sure).  Looks like some memory overwrite issue. The trace is
> as
> > follows:
>
> Attached is a patch that fixes the problem... (it was debugging from
> an earlier version)
>

Yup, that fixes the problem.

PFA, a revised version of Alex' patch. I have added the relevant pg_dump
related changes too. As I mentioned earlier, I still don't know whether
Alex' syscache related changes are necessary, but I will leave it to the
patch reviewers to decide :)

This combined patch meets the following TODOs:

* Add logic to disallow ADD CONSTRAINT ONLY to parent of an inheritance
hierarchy

* Add logic to mark inherited constraints in the children:
This is achieved by introducing bool "conislocal" and int4 "coninhcount"
attributes in pg_constraint. The behaviour of these 2 attributes is pretty
similar to attislocal and attinhcount attributes in pg_attribute.

* Add logic to disallow dropping inherited constraints directly on children
Obviously they will get dropped if a DROP CONSTRAINT is fired on the parent.
with recurse set to true (this is the default behaviour)

* Modify the pg_dump logic to use the new pg_constraint based attributes
logic for versions above 80300 (or should it be PG_VERSION_NUM 80400?).

Please direct comments/feedback towards both me and Alex.

Regards,
Nikhils
-- 
EnterpriseDB http://www.enterprisedb.com

Attachment: inherited_constraints_v3.0.patch
Description: text/x-patch (63.7 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2008-04-01 10:23:47
Subject: Re: actualized SQL/PSM patch
Previous:From: Simon RiggsDate: 2008-04-01 08:04:21
Subject: Re: [HACKERS] ANALYZE getting dead tuple counthopelessly wrong

pgsql-patches by date

Next:From: tomasDate: 2008-04-01 12:02:14
Subject: Re: [HACKERS] Avahi support for Postgresql
Previous:From: Mathias HasselmannDate: 2008-04-01 07:35:56
Subject: Re: [HACKERS] Avahi support for Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group