Re: generic builtin functions

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: generic builtin functions
Date: 2005-11-10 20:28:55
Message-ID: 4373AD87.2010006@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>
>>What I want to have is some builtin functions that can be used as the
>>input/output/cast/etc functions for each enum type.
>>
>>
>
>The hard part of that is going to be figuring out how to get the
>information to the functions about which enum type they're being invoked
>for. Output functions in particular are handed little except the data
>value itself.
>
>Possibly the internal representation of an enum could be 8 bytes: 4
>bytes for type OID and 4 more for value. No doubt the mysql guys would
>rag on us for using too much disk space :-(. But if you did that then
>the generics would just be anyenum and done.
>
>

Eek! I would be prepared to go to quite a lot of trouble to avoid that.

My idea was to have the functions that need access to the text values
look up fcinfo->flinfo->fn_oid and then use that to look up the type
info. But that would mean we would need pg_proc entries for these
functions for each enum, even if it's the same function underneath,
wouldn't it?

>>I guess we could invent an anyenum pseudotype without actually exposing
>>it via the grammar.
>>
>>
>
>Why do you think you need to hide it?
>
>
>
>

Just desire not to clutter needlessly.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2005-11-10 20:35:38 8.0 -> 8.1 dump duplicate key problem?
Previous Message Joshua D. Drake 2005-11-10 20:23:46 Re: Obtaining a source tree from CVS