Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-16 Thread Alvaro Herrera
Excerpts from Nikhil Sontakke's message of lun abr 16 03:56:06 -0300 2012: > > > Displace yes. It would error out if someone says > > > > > > ALTER TABLE ONLY... CHECK (); > > > > > > suggesting to use the ONLY with the CHECK. > > > > I'd say the behavior for that case can revert to the PostgreSQL

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-15 Thread Nikhil Sontakke
> > Displace yes. It would error out if someone says > > > > ALTER TABLE ONLY... CHECK (); > > > > suggesting to use the ONLY with the CHECK. > > I'd say the behavior for that case can revert to the PostgreSQL 9.1 > behavior. > If the table has children, raise an error. Otherwise, add an inheritab

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-15 Thread Noah Misch
On Thu, Apr 12, 2012 at 10:50:31AM +0530, Nikhil Sontakke wrote: > > > CHECK NO INHERIT sounds fine to me; will that display ALTER TABLE ONLY > > > x as the one true way of doing this? > > > > s/display/displace/, I think you meant? Yeah, that's what I understand > > the proposal to be. +1 for th

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-13 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Andrew Dunstan's message of mié abr 11 15:51:51 -0300 2012: >> On 04/11/2012 02:45 PM, Tom Lane wrote: >>> I don't really care for the idea that the ONLY goes in a different place >>> for this operation than for every other kind of ALTER TABLE, but it does >

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Nikhil Sontakke
Hi, Cumulative reaction to all the responses first: Whoa! :) I was under the impression that a majority of us felt that the current mechanism was inadequate. Also if you go through the nabble thread, the fact that CREATE TABLE did not support such constraints was considered to be an annoyance. A

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Tom Lane
Robert Haas writes: > +1 for fixing up the syntax before 9.2 goes out the door. I think the > original syntax was misguided to begin with. Well, it was fine in isolation, but once you consider how to make CREATE TABLE do this too, it's hard to avoid the conclusion that you need to attach the mod

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Robert Haas
On Wed, Apr 11, 2012 at 2:45 PM, Tom Lane wrote: > Alvaro Herrera writes: >> Excerpts from Nikhil Sontakke's message of mié abr 11 15:07:45 -0300 2012: >>> This patch removes the support for : >>> >>> ALTER TABLE ONLY constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0); >>> >>> and uses >>>

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Andrew Dunstan
On 04/11/2012 03:06 PM, Tom Lane wrote: I'd propose "CHECK NO INHERIT", though, as (a) it seems better English and (b) it avoids creating any new keyword. I could live with that too. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to yo

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Alvaro Herrera
Excerpts from Andrew Dunstan's message of mié abr 11 15:51:51 -0300 2012: > > On 04/11/2012 02:45 PM, Tom Lane wrote: > > Alvaro Herrera writes: > >> Excerpts from Nikhil Sontakke's message of mié abr 11 15:07:45 -0300 2012: > >>> This patch removes the support for : > >>> > >>> ALTER TABLE ONL

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Andrew Dunstan
On 04/11/2012 02:45 PM, Tom Lane wrote: Alvaro Herrera writes: Excerpts from Nikhil Sontakke's message of mié abr 11 15:07:45 -0300 2012: This patch removes the support for : ALTER TABLE ONLY constraint_rename_test ADD CONSTRAINT con2 CHECK (b> 0); and uses ALTER TABLE constraint_rename

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Nikhil Sontakke's message of mié abr 11 15:07:45 -0300 2012: >> This patch removes the support for : >> >> ALTER TABLE ONLY constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0); >> >> and uses >> >> ALTER TABLE constraint_rename_test ADD CONSTRAINT co

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Alvaro Herrera
Excerpts from Nikhil Sontakke's message of mié abr 11 15:07:45 -0300 2012: > This patch removes the support for : > > ALTER TABLE ONLY constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0); > > and uses > > ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK ONLY (b > 0); > > Is t

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-04-11 Thread Nikhil Sontakke
Hi, So, I have a patch for this. This patch introduces support for CHECK ONLY syntax while doing a CREATE TABLE as well as during the usual ALTER TABLE command. Example: create table atacc7 (test int, test2 int CHECK ONLY (test>0), CHECK (test2>10)); create table atacc8 () inherits (atacc7); p

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-02-01 Thread Peter Eisentraut
On ons, 2012-01-18 at 18:17 -0500, Robert Haas wrote: > I agree with Peter that we should have we should have CHECK ONLY. > ONLY is really a property of the constraint, not the ALTER TABLE > command -- if it were otherwise, we wouldn't need to store it the > system catalogs, but of course we do. T

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-01-18 Thread Robert Haas
On Wed, Jan 18, 2012 at 12:10 AM, Nikhil Sontakke wrote: >> >> It appears that the only way to create a non-inherited CHECK constraint >> >> is using ALTER TABLE.  Is there no support in CREATE TABLE planned? >> >> That looks a bit odd. >> > >> > There are no plans to do that AFAIR, though maybe y

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-01-17 Thread Nikhil Sontakke
> >> It appears that the only way to create a non-inherited CHECK constraint > >> is using ALTER TABLE. Is there no support in CREATE TABLE planned? > >> That looks a bit odd. > > > > There are no plans to do that AFAIR, though maybe you could convince > > Nikhil to write the patch to do so. > > T

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-01-17 Thread Jim Nasby
On Jan 17, 2012, at 11:07 AM, Alvaro Herrera wrote: > Excerpts from Peter Eisentraut's message of mar ene 17 13:59:57 -0300 2012: >> It appears that the only way to create a non-inherited CHECK constraint >> is using ALTER TABLE. Is there no support in CREATE TABLE planned? >> That looks a bit odd

Re: [HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-01-17 Thread Alvaro Herrera
Excerpts from Peter Eisentraut's message of mar ene 17 13:59:57 -0300 2012: > It appears that the only way to create a non-inherited CHECK constraint > is using ALTER TABLE. Is there no support in CREATE TABLE planned? > That looks a bit odd. There are no plans to do that AFAIR, though maybe you

[HACKERS] how to create a non-inherited CHECK constraint in CREATE TABLE

2012-01-17 Thread Peter Eisentraut
It appears that the only way to create a non-inherited CHECK constraint is using ALTER TABLE. Is there no support in CREATE TABLE planned? That looks a bit odd. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/