X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 00CC29DC99B for ; Thu, 9 Feb 2006 13:12:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91283-04 for ; Thu, 9 Feb 2006 13:12:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id AC0149DC990 for ; Thu, 9 Feb 2006 13:12:36 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k19HCZ0u002304; Thu, 9 Feb 2006 12:12:35 -0500 (EST) To: "BigSmoke" cc: pgsql-sql@postgresql.org Subject: Re: unique constraint instead of primary key? what disadvantage(ODBC usage)? In-reply-to: <1139502179.764894.35960@o13g2000cwo.googlegroups.com> References: <20060208210455.5d6f5bf9.gry@ll.mit.edu> <1139502179.764894.35960@o13g2000cwo.googlegroups.com> Comments: In-reply-to "BigSmoke" message dated "09 Feb 2006 08:22:59 -0800" Date: Thu, 09 Feb 2006 12:12:35 -0500 Message-ID: <2303.1139505155@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200602/104 X-Sequence-Number: 24114 "BigSmoke" 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