Re: CREATE TABLE docs fix
От | Alvaro Herrera |
---|---|
Тема | Re: CREATE TABLE docs fix |
Дата | |
Msg-id | 20020901140730.1d485d3f.alvherre@atentus.com обсуждение исходный текст |
Ответ на | Re: CREATE TABLE docs fix (Rod Taylor <rbt@zort.ca>) |
Список | pgsql-patches |
En 01 Sep 2002 13:44:37 -0400 Rod Taylor <rbt@zort.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).
В списке pgsql-patches по дате отправления: