Re: primary key and existing unique fields - Mailing list pgsql-general

From Richard Huxton
Subject Re: primary key and existing unique fields
Date
Msg-id 417F5AB5.3010101@archonet.com
Whole thread Raw
In response to primary key and existing unique fields  ("Sally Sally" <dedeb17@hotmail.com>)
List 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

pgsql-general by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: Theory
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Bug or stupidity