Re: primary key and existing unique fields

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sally Sally <dedeb17(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: primary key and existing unique fields
Date: 2004-10-27 08:22:13
Message-ID: 417F5AB5.3010101@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sally Sally wrote:
> This
> existing unique field will have to be a character of fixed length
> (VARCHAR(12)) because although it's a numeric value there will be
> leading zeroes.

Plenty of people are contributing their tuppence-worth regarding the
choice of surrogate vs natural primary key.

Can I just point out that your existing unique field is EITHER a numeric
value OR it has a fixed number of characters - numbers don't have
leading zeros.

If what you have is a number, then perhaps consider int8/numeric types
and format appropriately when you display the values.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2004-10-27 08:26:56 Re: Bug or stupidity
Previous Message Thomas Hallgren 2004-10-27 07:43:36 Re: Theory