proposal: condition blocks in psql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема proposal: condition blocks in psql
Дата
Msg-id CAFj8pRA9HYo8stKNogPHMZ6_a6Ug+k5+94p=EpgvPBNFdQamhA@mail.gmail.com
обсуждение исходный текст
Ответы Re: proposal: condition blocks in psql
Re: proposal: condition blocks in psql
Список pgsql-hackers
Hi

I am thinking about simplifying a deployment some multiversion PostgreSQL extensions, and scripts.

With current possibilities, we have to use DO statement, what is not optimal or possible in some use cases. The implementation of condition block (possible nested) is very simple.

The proposed syntax of new psql commands

\if_ver_eq 9.2
 ...
\else
\endif

\if_ver_gt 9.2
\if_ver_ge 9.2
\if_ver_le 9.2
\if_ver_lt 9.2

minor versions can be supported too

\if_ver_ge 9.2.0
\endif

\if_def psqlvariable
\if_eq psqlvariable
\if_ne psqlvariable 

What do you thinking about it?

Regards

Pavel

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Semantics of pg_file_settings view
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: proposal: condition blocks in psql