logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: NOT NULL Fixes: msg#00114

Subject: Re: NOT NULL Fixes
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@xxxxxx>
> 
> PGP Key: http://www.rbt.ca/rbtpub.asc

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

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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>