Re: Implementing SQL/PSM for PG 8.2

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Implementing SQL/PSM for PG 8.2
Дата
Msg-id 42C09C89.3030805@samurai.com
обсуждение исходный текст
Ответ на Re: Implementing SQL/PSM for PG 8.2  (Jan Wieck <JanWieck@Yahoo.com>)
Ответы Re: Implementing SQL/PSM for PG 8.2  (Rod Taylor <pg@rbt.ca>)
Re: Implementing SQL/PSM for PG 8.2  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Jan Wieck wrote:
> The whole parser is a hack that attempts to parse the procedural parts 
> of the function but preserving the SQL parts as query strings while 
> substituting variables with numbered parameters. That is anything but 
> clean. It was the only way I saw at the time of implementation to build 
> a parser that automatically supports future changes of the main Postgres 
> query language.

I agree the current parser is a hack, but it's difficult to see how else 
it could be implemented. One possibility I've mentioned in the past is 
to rewrite the main SQL parser by hand (e.g. as a recursive descent 
parser), so that we could directly call into the main SQL parser from 
the PL/PgSQL parser. I believe that would let us embed SQL in PL/PgSQL 
without needing to teach the PL/PgSQL anything about the main SQL 
grammar. But of course this has the downside of needing to write and 
maintain a recursive descent parser.

Any better ideas?

-Neil


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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: Implementing SQL/PSM for PG 8.2
Следующее
От: Andrew Dunstan
Дата:
Сообщение: language handlers in public schema