Re: automatic value conversion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sebastian Boehm <pg(at)seb(dot)exse(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: automatic value conversion
Date: 2007-03-24 18:08:31
Message-ID: 7471.1174759711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sebastian Boehm <pg(at)seb(dot)exse(dot)net> writes:
> the functions function_in and function_out should be called
> automatically on select or insert / update.
> How can I change the table definition to use function_in and
> function_out transparently for me (as if the table had a text colum)

You would have to create a new data type and make those functions
be the I/O functions of the type.

It sorta looks to me like you are reinventing the concept of an ENUM
column. This has been done before --- see enumkit
http://archives.postgresql.org/pgsql-hackers/2005-10/msg01243.php
as well as the currently pending patch to integrate the feature
into core Postgres.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2007-03-24 18:25:34 Re: Limiting user connnections on 7.4
Previous Message Jim Nasby 2007-03-24 18:06:59 Re: Tracking disk writes?