pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedbtree_gist, gint4_union
4+ messages / 3 participants
[nested] [flat]
* btree_gist, gint4_union
@ 2003-02-26 19:05 Itai Zukerman <zukerman@math-hat.com>
2003-03-17 19:59 ` Re: btree_gist, gint4_union Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Itai Zukerman @ 2003-02-26 19:05 UTC (permalink / raw)
To: ; +Cc: pgsql-sql
In contrib/btree_gist/ I see:
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);
Is the int4 return type declared above a bug?
--
Itai Zukerman <http://www.math-hat.com/~zukerman/;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: btree_gist, gint4_union
2003-02-26 19:05 btree_gist, gint4_union Itai Zukerman <zukerman@math-hat.com>
@ 2003-03-17 19:59 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-03-17 20:50 ` Re: btree_gist, gint4_union Tom Lane <tgl@sss.pgh.pa.us>
2003-03-17 21:06 ` Re: btree_gist, gint4_union Itai Zukerman <zukerman@math-hat.com>
0 siblings, 2 replies; 4+ messages in thread
From: Bruce Momjian @ 2003-03-17 19:59 UTC (permalink / raw)
To: Itai Zukerman <zukerman@math-hat.com>; +Cc: pgsql-sql
I am confused by your question. It seems it is declared as returning an
int.
---------------------------------------------------------------------------
Itai Zukerman wrote:
> In contrib/btree_gist/ I see:
>
> 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);
>
> Is the int4 return type declared above a bug?
>
> --
> Itai Zukerman <http://www.math-hat.com/~zukerman/;
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: btree_gist, gint4_union
2003-02-26 19:05 btree_gist, gint4_union Itai Zukerman <zukerman@math-hat.com>
2003-03-17 19:59 ` Re: btree_gist, gint4_union Bruce Momjian <pgman@candle.pha.pa.us>
@ 2003-03-17 20:50 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 2003-03-17 20:50 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Itai Zukerman <zukerman@math-hat.com>; pgsql-sql
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I am confused by your question. It seems it is declared as returning an
> int.
I suspect that all of the GiST union methods should be declared to
return 'internal', but Oleg or Teodor would probably know better.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: btree_gist, gint4_union
2003-02-26 19:05 btree_gist, gint4_union Itai Zukerman <zukerman@math-hat.com>
2003-03-17 19:59 ` Re: btree_gist, gint4_union Bruce Momjian <pgman@candle.pha.pa.us>
@ 2003-03-17 21:06 ` Itai Zukerman <zukerman@math-hat.com>
1 sibling, 0 replies; 4+ messages in thread
From: Itai Zukerman @ 2003-03-17 21:06 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: 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/;
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-03-17 21:06 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-26 19:05 btree_gist, gint4_union Itai Zukerman <zukerman@math-hat.com>
2003-03-17 19:59 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-03-17 20:50 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-03-17 21:06 ` Itai Zukerman <zukerman@math-hat.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox