Skip site navigation (1) Skip section navigation (2)

Re: User defined I/O conversion casts

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: User defined I/O conversion casts
Date: 2008-10-30 20:05:34
Message-ID: 490A138E.80100@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> 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 (the new beast, CREATE CAST ... WITH INOUT)
>> f = use cast function specified in castfunc field.
>> castfunc is 0 for methods b and i.
> 
> Seems sane to me.  If you do that, please add a check in the opr_sanity
> regression test that castfunc is nonzero if and only if castmethod is f.

Here's a patch. It seems pretty straightforward, I'll apply this 
tomorrow, barring objections. Note to self: bump the catalog version.

BTW, it looks like we don't have any test cases for the CREATE CAST 
command. I think I'll add one.

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

Attachment: user-defined-io-casts-2.patch
Description: text/x-diff (43.1 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Gregory StarkDate: 2008-10-30 20:16:38
Subject: Re: PG_PAGE_LAYOUT_VERSION 5 - time for change
Previous:From: Gregory StarkDate: 2008-10-30 20:02:50
Subject: Updated posix fadvise patch v19

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group