Search Postgresql Archives

Re: Multicolumn primary key with null value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Primary keys are defined as 'unique not null' even if they are composite. So I believe postgres would not let you do that:

5.3.4. Primary Keys

Technically, a primary key constraint is simply a combination of a unique constraint and a not-null constraint.
....

A primary key indicates that a column or group of columns can be used as a unique identifier for rows in the table. (This is a direct consequence of the definition of a primary key. Note that a unique constraint does not, by itself, provide a unique identifier because it does not exclude null values.) This is useful both for documentation purposes and for client applications.

http://www.postgresql.org/docs/8.1/static/ddl-constraints.html


Szymon Guz wrote:
Does any SQL standard allows for a multicolumn primary key where in one record there is a null in on of the primary key columns?

regards
Szymon Guz

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux