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

Re: Check constraints on partition parents only?

From: Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Jerry Sievers <gsievers19(at)comcast(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Check constraints on partition parents only?
Date: 2011-07-28 14:01:46
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers
> This approach certainly can't work, because a table can be both an
> inheritance parent and an inheritance child.  It could have an ONLY
> constraint, and also inherit a copy of the same constraint for one or
> more parents.  IOW, the fact that conislocal = true does not mean that
> coninhcount is irrelevant.

Oh I see.

> I think what you probably want to do is
> either (a) add a new column or (b) change conislocal to a char value
> and make it three-valued:
> n = inherited constraint, no local definition
> o = defined locally as an "ONLY" constraint
> i = defined locally as a non-ONLY constraint
> I think I favor the latter approach as more space-efficient, but I
> hear Tom muttering about backward-compatibility...
Yeah, in your case too an initdb would be required, so might as well go down
the route of a new column. Any preferences for the name?

constatic or confixed



In response to


pgsql-hackers by date

Next:From: Robert HaasDate: 2011-07-28 14:05:04
Subject: Re: sinval synchronization considered harmful
Previous:From: Robert HaasDate: 2011-07-28 13:54:52
Subject: Re: Check constraints on partition parents only?

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