Alter table .. Add primary key - Mailing list pgsql-hackers

From Rod Taylor
Subject Alter table .. Add primary key
Date
Msg-id 1038499584.54963.4.camel@jester
Whole thread Raw
List pgsql-hackers
When doing an alter table .. add primary key operation on columns which
are not marked as null, would it be appropriate to mark the primary key
columns not null?

This follows with create table auto-marking columns null for primary
keys.


rbt=# \d ar    Table "public.ar"Column | Type | Modifiers 
--------+------+-----------col    | r    | 

rbt=# alter table ar add primary key (col);
ERROR:  Existing attribute "col" cannot be a PRIMARY KEY because it is
not marked NOT NULL

-- 
Rod Taylor <rbt@rbt.ca>



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Auto Vacuum Daemon (again...)
Next
From: Bruce Momjian
Date:
Subject: Re: nested transactions