WIP: hooking parser

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема WIP: hooking parser
Дата
Msg-id 162867790902110205s7878330ax67a7e6f2bdbeb53@mail.gmail.com
обсуждение исходный текст
Ответы Re: WIP: hooking parser
Re: WIP: hooking parser
Список pgsql-hackers
Hello

some years ago there was some plans about parser's extensibility. I am
able write bison extensions, but I thing, so lot of work should be
done via hooking of transform stage.

I did small example - real implementation of Oracle's decode function.
It's based on hooking transformExpr function.

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)

postgres=# select decode(3,2,'ahoj',3,'Petr',1,'Pavel',null, 'jaja');
 decode
--------
 Petr
(1 row)

postgres=# select decode(6,2,'ahoj',3,'Petr',1,'Pavel',null, 'jaja');
 decode
--------

(1 row)

postgres=# select decode(6,2,'ahoj',3,'Petr',1,'Pavel',null, 'jaja', 'Milos');
 decode
--------
 Milos
(1 row)

Any ideas, notes?

regards
Pavel Stehule

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: temporarily stop autovacuum
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Psql List Languages