NOT NULL Fixes

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема NOT NULL Fixes
Дата
Msg-id 1039096174.36626.62.camel@jester
обсуждение исходный текст
Ответы Re: NOT NULL Fixes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: NOT NULL Fixes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Enforces NOT NULL constraints to be applied against new PRIMARY KEY
columns in DefineIndex.  So, ALTER TABLE ... PRIMARY KEY will now
automatically add the NOT NULL constraint.  It appeared the alter_table
regression test wanted this to occur, as after the change the regression
test better matched in inline 'fails'/'succeeds' comments.

At first glance, I didn't see any documentation that said this did not
happen.

It's not as efficient as it could be for multi-key primary keys, but
it's certainly better than the old method.  Besides, how often do you
alter in a multi-key primary key on a table with lots of data.


It also corrects the inheritance case:

b=# create table a (aa int4);
CREATE TABLE
b=# create table b (bb int4, primary key(aa, bb)) inherits (a);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'b_pkey'
for table 'b'
CREATE TABLE
b=# \d b
       Table "public.b"
 Column |  Type   | Modifiers
--------+---------+-----------
 aa     | integer | not null
 bb     | integer | not null
Indexes: b_pkey primary key btree (aa, bb)


The NOT NULL clause will NOT cascade to children at the moment.  Perhaps
this should be the other way around?

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: doc update
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Hierarchical queries a la Oracle patch. for 7.3rc1.