Re: string primary key

From: "Martin Kuria" <martinkuria(at)hotmail(dot)com>
To: bruno(at)wolff(dot)to, mark(at)gibsonsoftware(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: string primary key
Date: 2006-05-12 09:48:35
Message-ID: BAY22-F970AC692A8B42AC2C3429A6AC0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Using interger as opposed to a character as a primary key has an advantage
when it comes to querying data in the table, it is faster searching with an
interger as compared to characters date types

+-----------------------------------------------------+
| Martin W. Kuria (Mr.) martin(dot)kuria(at)unon(dot)org
+----------------------------------------------------+

>From: Bruno Wolff III <bruno(at)wolff(dot)to>
>To: Mark Gibson <mark(at)gibsonsoftware(dot)com>
>CC: pgsql-general(at)postgresql(dot)org
>Subject: Re: [GENERAL] string primary key
>Date: Fri, 12 May 2006 01:54:17 -0500
>
>On Thu, May 11, 2006 at 09:52:41 -0600,
> Mark Gibson <mark(at)gibsonsoftware(dot)com> wrote:
> > Is there a disadvantage to having the primary key for a table be a text
> > type vs. an integer type? Performance? Any difference between having a
> > varchar or char as a primary key?
>
>You probably want to use 'text' unless there is a busniess rule limiting
>the size of the field.
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-05-12 10:15:59 Re: compiling postgres on solaris and DBD::Pg
Previous Message Melanie Diedericks 2006-05-12 09:37:35 Postgres - Vacuum error: No such file or directory