Re: CREATE TABLE docs fix

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: neilc(at)samurai(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: CREATE TABLE docs fix
Date: 2002-09-01 18:07:30
Message-ID: 20020901140730.1d485d3f.alvherre@atentus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

En 01 Sep 2002 13:44:37 -0400
Rod Taylor <rbt(at)zort(dot)ca> escribió:

> > > On Sun, 2002-09-01 at 04:00, Neil Conway wrote:
> > > > This patch fixes a minor inaccuracy in the documentation: NOT NULL
> > > > is not synonymous with CHECK (xxx IS NOT NULL) -- for example,
> > > > consider ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL',
> > > > not a check constraint.
>
> The case you brought up is more of a bug or mis-implementation of alter
> table / add primary key. I guess you're right. They're not, but they
> should be.

I think it's very difficult in the general case to determine from a
CHECK constraint if it is setting some column to not null; but if it was
easy, then you better translate(*) it into the SET NOT NULL form, and leave
the ADD PRIMARY KEY code alone.

Anyway IMHO this should be documented to prevent possible confusion.

(*) but I think auto-converting some things into some other things that
may not be what the user wants is a recipe for user frustration.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El sabio habla porque tiene algo que decir;
el tonto, porque tiene que decir algo" (Platon).

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Karim Mribti 2002-09-01 19:16:11 Spanish Translation - libpq-es.po
Previous Message Rod Taylor 2002-09-01 17:44:37 Re: CREATE TABLE docs fix