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

From: Nikhil Sontakke <nikkhils(at)gmail(dot)com>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: how to create a non-inherited CHECK constraint in CREATE TABLE
Date: 2012-01-18 05:10:04
Message-ID: CANgU5Zff1a-e2_VAjdcOKypiweTq-Gm+RacUTRkEB5PaeE9jBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> >> 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.
>
> That certainly doesn't meet the principle of least surprise... CREATE
> TABLE should support this.
>

Well, the above was thought about during the original discussion and
eventually we felt that CREATE TABLE already has other issues as well, so
not having this done as part of creating a table was considered acceptable
then:

http://postgresql.1045698.n5.nabble.com/Check-constraints-on-partition-parents-only-tt4633334.html#a4647144

But, let me have a stab at it when I get some free cycles.

Regards,
Nikhils

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-01-18 05:28:29 Re: psql \timing vs failed statements
Previous Message Robert Haas 2012-01-18 03:28:45 Re: [v9.2] LEAKPROOF attribute of FUNCTION (Re: [v9.2] Fix Leaky View Problem)