Re: NOT NULL Fixes

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: NOT NULL Fixes
Date: 2002-12-10 23:21:33
Message-ID: 200212102321.gBANLXv24058@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Rod Taylor wrote:
-- Start of PGP signed section.
> 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(at)rbt(dot)ca>
>
> PGP Key: http://www.rbt.ca/rbtpub.asc

[ Attachment, skipping... ]
-- End of PGP section, PGP failed!

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Ian Barwick 2002-12-10 23:50:40 Re: [BUGS] Bug #718: request for improvement of /? to show /d+ /l+
Previous Message Bruce Momjian 2002-12-10 23:06:54 Re: [BUGS] Bug #718: request for improvement of /? to show