dbTalk Databases Forums  

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

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] numerics lose scale and precision in views of unions in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] numerics lose scale and precision in views of unions - 08-09-2006 , 04:34 PM






--nextPart2651651.BDzLDMFdo0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

It appears that when you create a view of a union, numeric data types
loose their scale and precision.

db=3D> create table t1 (c1 numeric(4,2));
CREATE TABLE

db=3D> create view v1 as select c1 from t1;
CREATE VIEW

db=3D> \d v1
View "brian.v1"
Column | Type | Modifiers
=2D-------+--------------+-----------
c1 | numeric(4,2) |
View definition:
SELECT t1.c1
FROM t1;


db=3D> create view v2 as select c1 from t1 union select c1 from t1;
CREATE VIEW
db=3D> \d v2
View "brian.v2"
Column | Type | Modifiers
=2D-------+---------+-----------
c1 | numeric |
View definition:
SELECT t1.c1
FROM t1
UNION
SELECT t1.c1
FROM t1;

db=3D> create view v3 as select c1::numeric(4,2) from t1 union select c1::n=
umeric(4,2) from t1;
CREATE VIEW

db=3D> \d v3
View "brian.v3"
Column | Type | Modifiers
=2D-------+---------+-----------
c1 | numeric |
View definition:
SELECT t1.c1
FROM t1
UNION
SELECT t1.c1
FROM t1;


=2D-=20
Brian C. DeRocher @ Mitretek Systems
This email was signed using OpenPGP.

--nextPart2651651.BDzLDMFdo0
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iQCVAwUARNpSmW5Q6fdPj+zIAQKoZgQApwue8+GbIjDlgmSWLm 0TCzxhlI6pfr2D
U6fCG3W+Buf4RqRu73SZWs7xNjkvyOGniYpoR/tK/gPayjrac8+MX+lKMeUU1UFQ
JRs/aSxJa9ULnup6JOkcjbRgqDTHGlweXWgaOpZza1WZe/7eRXcNjgEIdiRcWDQt
ci4vzeIQKDU=
=7YKk
-----END PGP SIGNATURE-----

--nextPart2651651.BDzLDMFdo0--

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] numerics lose scale and precision in views of unions - 08-09-2006 , 05:22 PM






"Brian C. DeRocher" <brian.derocher (AT) mitretek (DOT) org> writes:
Quote:
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...2/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?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.