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

From: Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixing contrib/isn for float8-pass-by-value
Date: 2008-11-28 22:01:33
Message-ID: 22CB967F-3833-4045-B98A-760D5489A9ED@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I was going to say something like that but couldn't come up with a
nice syntax. The syntax you gave seems obvious in retrospect.

I wonder if this should be tied in some way with creating binary-
compatible casts or anything. Probably not since the data type can
just make them itself.

greg

On 28 Nov 2008, at 08:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I wrote:
>> 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.
>> ...
>> This is kinda ugly but I don't really see anything better.
>
> I had a better but more invasive idea: invent a new attribute for
> CREATE TYPE
>
> LIKE = typename
>
> which means "copy any unspecified representational details from the
> given pre-existing type". This would allow the .sql file to know
> less instead of more about what's happening, so it seems more
> future-proof. It's a bit more work than the makefile hack I was
> thinking about, but seems like a good investment. (I wouldn't
> propose this if I thought contrib/isn was the only user --- I expect
> there are other third-party modules with similar needs.)
>
> Comments?
>
> regards, tom lane
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-28 22:07:32 Re: Fixing contrib/isn for float8-pass-by-value
Previous Message Tom Lane 2008-11-28 21:59:19 Re: Statement-level triggers and inheritance