Re: [BUGS] numerics lose scale and precision in views of unions - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [BUGS] numerics lose scale and precision in views of unions
Date
Msg-id 20060809234804.GO20016@kenobi.snowman.net
Whole thread Raw
In response to Re: [BUGS] numerics lose scale and precision in views of unions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] numerics lose scale and precision in views of unions
List pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> "Brian C. DeRocher" <brian.derocher@mitretek.org> writes:
> > It appears that when you create a view of a union, numeric data types
> > loose their scale and precision.
>
> I think this is the same issue discussed here:
> http://archives.postgresql.org/pgsql-hackers/2004-12/msg00408.php
>
> That was just before 8.0 release, so the change got postponed and then
> seems to have slipped through the cracks :-(.  Any objections to
> fixing it for 8.2?

Sounds good to me.  I'd like to talk a bit about the expected behavior
of a numeric hash function.  This is the current behavior:

abc=# select * from test1;  a1
--------  1.001.0000   1.0
(3 rows)

abc=# select * from test1 group by a1; a1
------1.00
(1 row)

abc=# select distinct a1 from test1; a1
------1.00
(1 row)

I just want to double-check that this is the correct/expected behavior
(hopefully from the SQL spec?) and that a hash function need not concern
itself with the scale?

I'm guessing it's too late for 8.2, or would such a relatively
isolated/simple change be acceptable during the beta period (adding hash
functions for numeric types)?  Don't swear I'll actually get to them but
I'd like to and so I'd like to be hash out (hah!) the correct semantics.
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Buildfarm failure on ecpg/test/pgtypeslib
Next
From: Tom Lane
Date:
Subject: Re: Buildfarm failure on ecpg/test/pgtypeslib