Re: proposal: condition blocks in psql

Поиск
Список
Период
Сортировка
Искать
От
Merlin Moncure
Тема
Re: proposal: condition blocks in psql
Дата
Msg-id
CAHyXU0y34SHPRDwxPzB_rTYEH+GBJme6CicjhMkirA_DpiQHDQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Fabien COELHO <coelho@cri.ensmp.fr>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: proposal: condition blocks in psql "David G. Johnston" <david.g.johnston@gmail.com>
Re: proposal: condition blocks in psql Fabien COELHO <coelho@cri.ensmp.fr>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Fabien COELHO <coelho@cri.ensmp.fr>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Merlin Moncure <mmoncure@gmail.com>
Re: proposal: condition blocks in psql Corey Huinker <corey.huinker@gmail.com>
Re: proposal: condition blocks in psql Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: proposal: condition blocks in psql Fabien COELHO <coelho@cri.ensmp.fr>
Re: proposal: condition blocks in psql Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: proposal: condition blocks in psql Corey Huinker <corey.huinker@gmail.com>
Re: proposal: condition blocks in psql Pavel Stehule <pavel.stehule@gmail.com>
On Sun, Jun 28, 2015 at 1:59 AM, Fabien COELHO  wrote:
>
>>>> \if_ver_eq 9.2
>>>
>>>
>>>  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
>
>
> I agree with large but that would not necessarily mean complex. Also, some
> functions could be in SQL, and just the logic with PL/pgSQL.
>
>> * the plpgsql functions or anonymous functions create a transaction
>> borders
>> - what should not be wanted
>
>
> Hmmm... If something fails when installing an extension, a transaction
> border is probably a good thing? Also, the interaction of \if with possible
> BEGIN/COMMIT can lead to strange states.

Manual transaction control is the killer feature IMO; not being able
to do it forces code out of sql and into a scripting language.
Transaction management in 'psql scripting' is no more or less fragile
than in most imperative languages.

Personally, I prefer a server side solution to this problem (stored
procedures) so that the application can leverage this functionality
through the protocol.  However, psql extensions are probably worth it
in their own right.

merlin


В списке pgsql-hackers по дате отправления
От: Merlin Moncure
Дата:
Сообщение: Re: pg_trgm version 1.2
От: Andres Freund
Дата:
FAQ