Re: Re: Use int8 for int4/int2 aggregate accumulators?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Re: Use int8 for int4/int2 aggregate accumulators?
Date: 2001-08-14 15:00:29
Message-ID: 17602.997801229@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> create function rtest_viewfunc1(int4) returns int4 as
>> 'select count(*) from rtest_view2 where a = $1'
>> language 'sql';
>> + ERROR: return type mismatch in function: declared to return integer, returns bigint

> Maybe instead of testing for strict equality of the types, test for
> compatibility.

We could try to force-convert the result of an SQL function to the right
thing, I suppose, but I'm worried that that might mask programmer errors
more than it helps.

On the other hand, the equivalent forced conversion happens already in
plpgsql functions; it's only SQL-language functions that are so picky.
Maybe your idea is good. Anyone else have an opinion?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2001-08-14 15:01:19 Re: help on delete trigger.
Previous Message Peter Eisentraut 2001-08-14 14:57:52 Re: Re: Use int8 for int4/int2 aggregate accumulators?

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-08-14 15:00:44 Re: OID unsigned long long
Previous Message Peter Eisentraut 2001-08-14 14:57:52 Re: Re: Use int8 for int4/int2 aggregate accumulators?