X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7AEF39FA319 for ; Thu, 6 Jul 2006 13:02:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 39184-06 for ; Thu, 6 Jul 2006 13:02:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by postgresql.org (Postfix) with ESMTP id 01C809FA0EC for ; Thu, 6 Jul 2006 13:02:38 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id o60so12422nfa for ; Thu, 06 Jul 2006 09:02:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=RHQvC++icXavg68pjgKZZ8guKbHGfc+TANE4G7VrEQYLbztlApq0PUoFTHGmq9W1nO1PyqIYksQuh7ZvYDiUDrCG0GVw14XTM9j/+lpqh0aXWobtQ7B4+PdgzrpSjl4ng1wYtI2FsHCbiXbtEsfzXkuux3+BTLwhAAlk6xGNtNg= Received: by 10.78.136.7 with SMTP id j7mr267318hud; Thu, 06 Jul 2006 09:02:37 -0700 (PDT) Received: by 10.78.29.2 with HTTP; Thu, 6 Jul 2006 09:02:37 -0700 (PDT) Message-ID: Date: Thu, 6 Jul 2006 11:02:37 -0500 From: "Aaron Bono" To: "David Clarke" Subject: Re: Alternative to serial primary key Cc: pgsql-sql@postgresql.org In-Reply-To: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_94379_18397900.1152201757524" References: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com> X-Google-Sender-Auth: 6172f4f8b57e0524 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/66 X-Sequence-Number: 25640 ------=_Part_94379_18397900.1152201757524 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/6/06, David Clarke wrote: > > I posted a couple of weeks back a question regarding the use of a 100 > char column as a primary key and the responses uniformily advised the > use of a serial column. My concern is that the key is effectively > abstract and I want to use the column as a foreign key in other > tables. I have a simple question... why do you want to use the column as a foreign key in other tables? If you use the serial column then all you need is a simple join to get the 100 char column out in your query. If you need to make things simpler, just create a view that does the join for you. Either there is some requirement here that I am not aware of or it sounds like you may be trying to use a sledge hammer on a nail. -Aaron ------=_Part_94379_18397900.1152201757524 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/6/06, David Clarke <pigwin32@gmail.com> wrote:
I posted a couple of weeks back a question regarding the use of a 100
char column as a primary key and the responses uniformily advised the
use of a serial column. My concern is that the key is effectively
abstract and I want to use the column as a foreign key in other
tables.

I have a simple question... why do you want to use the column as a foreign key in other tables?  If you use the serial column then all you need is a simple join to get the 100 char column out in your query.  If you need to make things simpler, just create a view that does the join for you.

Either there is some requirement here that I am not aware of or it sounds like you may be trying to use a sledge hammer on a nail.

-Aaron

------=_Part_94379_18397900.1152201757524--