Re: User defined I/O conversion casts - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: User defined I/O conversion casts
Date
Msg-id 4909B722.9020404@enterprisedb.com
Whole thread Raw
In response to Re: User defined I/O conversion casts  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: User defined I/O conversion casts
List pgsql-hackers
(Resurrecting an old thread.)

Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> Patch attached. I'm using a magic OID "1" in pg_cast.castfunc field to
>> mark these extra I/O conversion casts.
> 
> Ugh.  That's really unacceptable (doesn't it make the oidjoins
> regression test fail?),

Yeah, a magical OID clearly has some issues. A new field in pg_cast is 
the obvious alternative. How about adding a "castmethod" char field, 
with values:
b = binary-compatible cast (CREATE CAST ... WITHOUT FUNCTION)
i = I/O coercion cast (the new beast, CREATE CAST ... WITH INOUT)
f = use cast function specified in castfunc field.

castfunc is 0 for methods b and i.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Optimizing COPY
Next
From: Tom Lane
Date:
Subject: Re: User defined I/O conversion casts