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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Re: Use int8 for int4/int2 aggregate accumulators?
Дата
Msg-id 200108141601.f7EG1BG07870@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Re: Use int8 for int4/int2 aggregate accumulators?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Peter Eisentraut <peter_e@gmx.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?

I don't know.  Doing a force for SQL functions and not for others seems
kind of confusing.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Serguei Mokhov"
Дата:
Сообщение: Re: int8 sequences --- small implementation problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Forcing GiST index to be used