Re: btree_gist, gint4_union

Поиск
Список
Период
Сортировка
От Itai Zukerman
Тема Re: btree_gist, gint4_union
Дата
Msg-id 87u1e18zz3.fsf@pip.dynamiclogic.com
обсуждение исходный текст
Ответ на Re: btree_gist, gint4_union  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-sql
> I am confused by your question.  It seems it is declared as returning an
> int.

>>   CREATE FUNCTION gint4_union(bytea, internal)
>>   RETURNS int4
>>   AS 'MODULE_PATHNAME'
>>   LANGUAGE 'C';
>> 
>> but gint4_union does this:
>> 
>>   INT4KEY *out = palloc(sizeof(INT4KEY));
>>   [...]
>>   PG_RETURN_POINTER(out);

The function returns type INT4KEY, which is a struct of 2 int4's, but
is declared as returning just int4.

It should be declared to return type int4key, no?

I don't think this actually has any negative consequences, though.

-- 
Itai Zukerman  <http://www.math-hat.com/~zukerman/>


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: upcasting multiplication in a query
Следующее
От: "Susan Hoddinott"
Дата:
Сообщение: Re: Create function statement with insert statement