Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Here's a patch. It seems pretty straightforward, I'll apply this > tomorrow, barring objections. Note to self: bump the catalog version. Looks sane in a fast once-over. I didn't cross-check the pg_cast.h data changes, but that's what the regressio

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> writes: 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

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> writes: 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

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > 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 (th

Re: [HACKERS] User defined I/O conversion casts

2008-10-30 Thread Heikki Linnakangas
(Resurrecting an old thread.) Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> 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?), Y

Re: [HACKERS] User defined I/O conversion casts

2008-08-29 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas <[EMAIL PROTECTED]> 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, it does if you create a ca

Re: [HACKERS] User defined I/O conversion casts

2008-08-29 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> 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?), I think that as things stand at the moment, you

Re: [HACKERS] User defined I/O conversion casts

2008-08-29 Thread Teodor Sigaev
Since 8.3, the system provides automatic I/O conversion casts between the built-in string types and other types, but there's currently no way for a user to declare additional casts using the I/O functions. You can always create a simple SQL function to do that, but it seems like we should pro