Breaking of existing apps with CVS version

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "Pgsql-Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Breaking of existing apps with CVS version
Date: 2000-11-23 04:00:26
Message-ID: 3.0.5.32.20001123150026.022b8ac0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


There is a minor breakage of existing apps that occurs with current CVS.

In 7.0 doing the following:

create table tsc(f1 int4 , f2 int4);
insert into tsc values(1,4);
select sum(f1)/sum(f2) from tsc;

would actually result in zero, since it worked with integers throughout. As
a result, I adopted the following strategy:

select cast(sum(f1) as float8)/sum(f2) from tsc;

which produced the expected results.

Now in 7.1 this breaks with:

ERROR: Unable to identify an operator '/' for types 'float8' and 'numeric'
You will have to retype this query using an explicit cast

Is there a reason why it doesn't promote float8 to numeric?

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-11-23 04:27:29 Re: Breaking of existing apps with CVS version
Previous Message Arnold.Zhu 2000-11-23 03:59:58 How to make @id or $id as parameter name in plpgsql, is it available?