Re: proposal: condition blocks in psql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: condition blocks in psql
Дата
Msg-id CAFj8pRD7QxVV66cxpVqhLCVR4mcaHMj2fA_J3nkHxG2tKYpsVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: condition blocks in psql  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: proposal: condition blocks in psql
Re: proposal: condition blocks in psql
Список pgsql-hackers


2015-06-28 7:49 GMT+02:00 Fabien COELHO <coelho@cri.ensmp.fr>:

The proposed syntax of new psql commands
\if_ver_eq 9.2
...
\else
\endif

What do you thinking about it?

Couldn't this kind of thing be done directly with PL/pgSQL?

you can use PL/pgSQL - but there are some limits

* maintenance large plpgsql functions

* the plpgsql functions or anonymous functions create a transaction borders - what should not be wanted 

* I cannot to use psql variables simply in plpgsql code (plpgsql has not any macro language) - so some patterns are implemented in plpgsql less readable

for example, if you can create a script that create some plpgsql function for specified PostgreSQL version, then using PLpgSQL for this purpose is suboptimal due less readability and maintainability

Pavel 

 

--
Fabien.

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: proposal: condition blocks in psql
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: Refactoring pgbench.c