Re: unique constraint instead of primary key? what disadvantage(ODBC usage)? - Mailing list pgsql-sql

From Tom Lane
Subject Re: unique constraint instead of primary key? what disadvantage(ODBC usage)?
Date
Msg-id 2303.1139505155@sss.pgh.pa.us
Whole thread Raw
In response to Re: unique constraint instead of primary key? what disadvantage(ODBC usage)?  ("BigSmoke" <bigsmoke@gmail.com>)
List pgsql-sql
"BigSmoke" <bigsmoke@gmail.com> writes:
> As far as I know, though, PRIMARY KEY does the same thing as UNIQUE NOT
> NULL in PostgreSQL.

They are 99.9% the same --- the *only* difference AFAIR is that PRIMARY
KEY establishes a default column-to-reference for FOREIGN KEY references
to the table.  UNIQUE doesn't; you can make a FOREIGN KEY reference to a
column that's only UNIQUE, but you'll always have to specify which column.
        regards, tom lane


pgsql-sql by date:

Previous
From: Andreas Roth
Date:
Subject: Change definition of a view
Next
From: "Keith Worthington"
Date:
Subject: Re: Change definition of a view