Re: [BUGS] numerics lose scale and precision in views of unions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: "Brian C(dot) DeRocher" <brian(dot)derocher(at)mitretek(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUGS] numerics lose scale and precision in views of unions
Date: 2006-08-10 04:23:37
Message-ID: 10136.1155183817@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> Makes me curious if it really makes sense to keep trailing zeros...

AFAIR we consider them mainly as a display artifact. An application
that's declared a column as numeric(7,2) is likely to expect to see
exactly two digits after the decimal point.

> Either 1.0 and 1.00 are
> the same thing (and thus should be displayed the same way), or they
> aren't (in which case they should be treated distinctly in, eg, a
> 'select distinct' clause).

Consistency has never been SQL's strong point ;-)

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Frost 2006-08-10 10:59:11 Re: [BUGS] numerics lose scale and precision in views of unions
Previous Message Tom Lane 2006-08-10 03:50:48 Re: BUG #2570: Connection closed unexpectedly

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2006-08-10 04:30:08 Re: 8.2 features status
Previous Message Mark Kirkwood 2006-08-10 04:02:14 Re: 8.2 features status