Re: zerofill: lost my leading zeroes

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Vincent Stoessel <vincent(at)xaymaca(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: zerofill: lost my leading zeroes
Date: 2002-03-20 19:36:39
Message-ID: 20020320193639.GA15706@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 20, 2002 at 01:41:46PM -0500,
Vincent Stoessel <vincent(at)xaymaca(dot)com> wrote:
> ugh,
> I created an integer column to hold zip codes and
> forgot that some US states have zips that start with zeroes.
> ie 03455 in new England. There is no zerofill option for
> the integer data type is there?

Either you want to store the zip code as a string instead of a number
or when you print out the number you want to use to_char using a format
of '00000'.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-03-20 20:27:56 Re: Notify argument?
Previous Message Bruce Momjian 2002-03-20 19:35:43 Firebird 2.0 moving to C++