Fixing contrib/isn for float8-pass-by-value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Fixing contrib/isn for float8-pass-by-value
Date: 2008-11-28 17:31:21
Message-ID: 27517.1227893481@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.in
sed '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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-11-28 17:31:35 Re: Review: Hot standby
Previous Message Tom Lane 2008-11-28 16:59:12 Re: Server Crash into contrib module ISN into 64bit OS