Re: numeric data type

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Corey <corey(at)bitworthy(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: numeric data type
Date: 2006-11-16 20:25:41
Message-ID: 20061116202541.69641.qmail@web31812.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


--- Corey <corey(at)bitworthy(dot)net> wrote:

>
> I've got the following:
>
> cc_exp_month numeric(2,0)
>
>
> So that I could input '06', for instance -- however the 0 doesn't make it's
> way into the column... I get '6' instead.
>
> I want to constrain this in the db, which is why I don't just use:
>
> cc_exp_month integer
>
>
> My question: what do I need to do to have the constraint ( two digits ) work,
> while still keeping the extra 0?

I guess that you will have to use char or varchar is you "want" to have 0 infront of 6. However,
if you want it to actually be a numeric, then you will need to use some kind of formatting to
display all 0-9 as 00-09 when you select records from this table.

Regards,

Richard Broersma Jr.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Phillip Smith 2006-11-16 20:37:55 Re: numeric data type
Previous Message Nelly Rodríguez 2006-11-16 20:20:20 unsuscribe