Re: btree_gist, gint4_union - Mailing list pgsql-sql

From Itai Zukerman
Subject Re: btree_gist, gint4_union
Date
Msg-id 87u1e18zz3.fsf@pip.dynamiclogic.com
Whole thread Raw
In response to Re: btree_gist, gint4_union  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: upcasting multiplication in a query
Next
From: "Susan Hoddinott"
Date:
Subject: Re: Create function statement with insert statement