Search Postgresql Archives

Re: different sort order for primary key index

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

 



On Wed, Oct 14, 2009 at 10:29:56AM -0400, Tom Lane wrote:
> Paul Hartley <phartley@xxxxxxxxx> writes:
> > ... I'm unclear
> > if PostgreSQL treats primary keys differently from unique, non-null
> > constraints.
> 
> The *only* thing that the system does specially with a primary key
> constraint is that a PK creates a default column target for foreign key
> references.

It also (silently) overrides any NOT NULL constraint doesn't it?  For
example:

  CREATE TABLE x ( id INT NULL PRIMARY KEY );

ends up with "id" being NOT NULL, even though I asked for it to be
nullable.  Not sure if it's useful for this case to be an error, though
it would be more in line with PG throwing errors when you asked for
something bad instead of making a best guess.

-- 
  Sam  http://samason.me.uk/

-- 
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