pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: BigSmoke <bigsmoke@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: unique constraint instead of primary key? what disadvantage(ODBC usage)?
Date: Thu, 09 Feb 2006 12:12:35 -0500
Message-ID: <2303.1139505155@sss.pgh.pa.us> (raw)
In-Reply-To: <1139502179.764894.35960@o13g2000cwo.googlegroups.com>
References: <20060208210455.5d6f5bf9.gry@ll.mit.edu>
	<1139502179.764894.35960@o13g2000cwo.googlegroups.com>

"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



view thread (9+ messages)  latest in thread

Message-ID: <2303.1139505155@sss.pgh.pa.us>
Permalink:  ../2303.1139505155@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2303.1139505155@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bigsmoke@gmail.com
  Subject: Re: unique constraint instead of primary key? what disadvantage(ODBC usage)?
  In-Reply-To: <2303.1139505155@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox