Re: WIP: hooking parser

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: hooking parser
Date: 2009-02-12 14:40:30
Message-ID: 162867790902120640x1cb24470s7662e2fefd0bcfb8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/2/12 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> On Wednesday 11 February 2009 12:05:03 Pavel Stehule wrote:
>> It works. And I thing, this should to solve lot of special task
>> related to increase compatibility with Oracle, Informix, or it could
>> be usefull for some others (json support).
>>
>> postgres=# load 'decode';
>> LOAD
>> postgres=# select
>> decode(null::integer,2,'ahoj',3,'Petr',1,'Pavel',null, 'jaja');
>> decode
>> --------
>> jaja
>> (1 row)
>
> I think what you want here is some way to define a function that takes an
> arbitrary number of arguments of arbitrary type and let the function figure
> everything out. I see no reason why this can't be a variant on CREATE
> FUNCTION, except that of course you need to figure out some API and function
> resolution details. But it doesn't have to be a completely different concept
> like a binary plugin.
>

Actually I need add some metada to parameter list, Question is, what
is more simple and more readable - descriptive or procedural solution.
And what we are able to implement.

example DECODE(any1, any2, (asany1, asany2).,(asany2)+)

Actually I thing so with some hook of parser transform stage we should
to this task more simply.

I found next sample, that should be solved via hook - emulation of
Oracle behave '' is null.

Regards
Pavel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-02-12 15:12:26 Re: [patch] fix for regression tests (locale cs_CZ)
Previous Message KaiGai Kohei 2009-02-12 14:31:56 Re: SE-PostgreSQL and row level security