Re: SET NULL / SET NOT NULL

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: SET NULL / SET NOT NULL
Дата
Msg-id
200203221920.g2MJK9N26123@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
Re: SET NULL / SET NOT NULL peter@helpnet_BUT_NOT_SPAM.com.au
Tom Lane wrote:
> "Ross J. Reedstrom"  writes:
> > BTW, is NULLABLE so ugly that no one wanted to comment on it?
> 
> I kinda liked it, actually, if we were going to use the SET syntax.
> But people seem to be focused in on this "let's make it look like
> CREATE" notion.  I'm willing to wait and see how far that can be made
> to work.

OK, how about:
SET CONSTRAINT NOT NULL

or
DROP CONSTRAINT NOT NULL

or simply:
SET/DROP NOT NULL

I think the problem with trying to get it look like CREATE TABLE is that
the plain NULL parameter to CREATE TABLE is meaningless and probably
should never be used.  I remember at one point pg_dump output NULL in
the schema output and it confused many people. NOT NULL is the
constraint, and I think any solution to remove NOT NULL has to include
the NOT NULL keyword.  I think this is also why SET NULL looks so bad. 
"CREATE TABLE test (x int NULL)" doesn't look great either.  :-)  What
is that NULL doing there?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610) 853-3000 +  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата:
Сообщение: Re: Use of PG_BINARY_R and "r"
От: Thomas Lockhart
Дата:
Сообщение: Re: SET NULL / SET NOT NULL
FAQ