Re: Best data type to use for sales tax percent

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: "pgsql-general(at)postgresql(dot)org mailing list" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Best data type to use for sales tax percent
Date: 2009-10-10 16:22:36
Message-ID: D54071D5-D0F3-4681-999C-A65ECC6F5555@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Oct 10, 2009, at 3:33 AM, Jasen Betts wrote:
>> CREATE DOMAN sales_tax_rate AS DECIMAL CHECK (VALUE >= 0 AND VALUE
>> <=1);
>
> why the latter check ( VALUE <=1 )?

Since this version has no scale on the DECIMAL, the second check keeps
it from being larger than 1.0, since it's presumably a percentage from
0% to 99%.

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2009-10-10 16:46:43 Building PG 8.4.1 with ossp-uuid on Centos 5.3
Previous Message Michal Szymanski 2009-10-10 15:05:32 Re: transaction ID wraparound - should I use 'VACUUM' or 'VACUUM FULL' ?