Fixing contrib/isn for float8-pass-by-value - Mailing list pgsql-hackers

From Tom Lane
Subject Fixing contrib/isn for float8-pass-by-value
Date
Msg-id 27517.1227893481@sss.pgh.pa.us
Whole thread Raw
Responses Re: Fixing contrib/isn for float8-pass-by-value  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
The problem reported by Rushabh Lathia boils down to the fact that
contrib/isn intends to define a datatype that is represented "just like
int8", but it supposes that int8 must be pass by reference.  There is
not anything wrong with the C code; the problem is the CREATE TYPE
command in isn.sql.  To fix this we need some way of passing the state
of FLOAT8PASSBYVAL into that SQL script.

It seems reasonably likely that isn.sql isn't going to be the only
place with such a problem, either.

What I propose doing about this is to extend pgxs.mk's rule

%.sql: %.sql.insed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@
endif

to also be prepared to replace "FLOAT8PASSBYVAL" with either
"PASSEDBYVALUE," (note the comma) or empty as appropriate.
Likewise for FLOAT4PASSBYVAL.  This will allow construction of
CREATE TYPE commands that properly reflect the attributes of the
various float and int64 types.

This is kinda ugly but I don't really see anything better.
Comments?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Review: Hot standby
Next
From: Tom Lane
Date:
Subject: Re: Review: Hot standby