Re: RfD: more powerful "any" types

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Hannu Krosing <hannu(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RfD: more powerful "any" types
Date: 2009-09-11 02:27:45
Message-ID: 603c8f070909101927p5ec5e37bve9e472898dd2c62f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 10, 2009 at 5:08 PM, Hannu Krosing <hannu(at)2ndquadrant(dot)com> wrote:
> On Thu, 2009-09-10 at 16:48 -0400, Robert Haas wrote:
>> On Thu, Sep 10, 2009 at 4:38 PM, Hannu Krosing <hannu(at)2ndquadrant(dot)com> wrote:
>> > On Thu, 2009-09-10 at 15:49 -0400, Tom Lane wrote:
>> >> Hannu Krosing <hannu(at)2ndQuadrant(dot)com> writes:
>> >> > On Thu, 2009-09-10 at 15:06 -0400, Robert Haas wrote:
>> >> >> It might be possible to make it work, but it's likely to create a lot
>> >> >> of bloat in pg_type, and will make it very difficult to implement
>> >> >> features such as anonymous functions (i.e. LAMBDA).
>> >>
>> >> > For functions, anonymous does not mean "impossible to identify" ;)
>> >>
>> >> > If it is something (semi)-permanent we should store it in pg_type and id
>> >> > it by oid, if it is really, really transient (say a closure generated
>> >> > upper in the function chain) we can probably assign it some kind of
>> >> > temporary, per-process oid for the duration of its existence
>> >>
>> >> Right.  See what we do for anonymous composite types.
>> >>
>> >>
>> >> > we could also change parser and translate reserved word ANY to typename
>> >> > "any" .
>> >>
>> >> ANY is a reserved word for good and sufficient reasons.  "Change the
>> >> parser" is not an answer.
>> >
>> > I suspect that alt least in some early SQL parsers all type names were reserved.
>> >
>> > Or do you see a possible conflict here ?
>> >
>> > What way can ANY be used in function type definition ?
>>
>> Perhaps you should try changing ANY to a non-reserved word in the
>> parser and see what happens.  If you come up with a way to resolve the
>> shift/reduce and/or reduce/reduce conflicts that will probably result,
>> submit a patch.
>
> I don't want it to be a non-reserved word.
>
> What I want is that this reserved word can be used in function argument
> and return type definitions with special meaning
>
> like reserver word FROM , which can be used in two different meanings
> like this
>
>  SELECT substring(fielda FROM myregex') FROM mytable;

OK so implement it.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2009-09-11 02:34:51 Re: Ragged CSV import
Previous Message David E. Wheeler 2009-09-11 02:11:40 Re: RfD: more powerful "any" types