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 18:04:29
Message-ID: 43738BAD.3060008@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:
>
>
>>I am looking at creating a few generic functions builtin for the enum
>>stuff. These would be tied to each enum type as it is created. However,
>>they should not really appear in pg_proc initially, as there wouldn't be
>>any enum types to tie them to anyway. But I want them to have reserved
>>oids and appear in the list of builtins.
>>
>>
>
>This feels wrong to me. Ways that might work include:
>
>1. Invent a pseudotype 'anyenum' comparable to 'anyarray', and define
>the generic functions as taking 'anyenum'.
>
>2. Don't try to define the generic operations as true functions, but
>make them special syntactic constructs comparable to ROW() or ARRAY[].
>
>I think I like #1 better, but it's hard to be sure when discussing
>it in a vacuum. How about being more specific about what you want
>to accomplish?
>
>
>
>

Yeah, after a bit more thought I came to the conclusion that it wouldn't
fly.

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 idea wasn't to
allow users to overload the functions.

I guess we could invent an anyenum pseudotype without actually exposing
it via the grammar.

Will keep thinking ...

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-11-10 18:15:07 Re: generic builtin functions
Previous Message Kevin Grittner 2005-11-10 18:00:12 Re: Comments from a Firebird user via Borland