Re: [RFC] Add an until-0 loop in psql
От
Pierre Ducroquet
Тема
Re: [RFC] Add an until-0 loop in psql
Дата
Msg-id
1774744.xorj2R6y5C@pierred-pdoc
Ответ на
Re: [RFC] Add an until-0 loop in psql (Daniel Verite)
Список
Дерево обсуждения
[RFC] Add an until-0 loop in psql Pierre Ducroquet <pierre.ducroquet@people-doc.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [RFC] Add an until-0 loop in psql Pierre Ducroquet <pierre.ducroquet@people-doc.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
On Monday, April 30, 2018 1:01:25 PM CEST Daniel Verite wrote: > Corey Huinker wrote: > > As of v11, DO blocks can do transactions. I think this will meet your > > needs. > They do support COMMIT and ROLLBACK in the current > development tree, but not VACUUM as in Pierre's example. > > postgres=# \echo :SERVER_VERSION_NAME > 11devel > > postgres=# do ' begin vacuum; end '; > ERROR: VACUUM cannot be executed from a function > CONTEXT: SQL statement "vacuum" > PL/pgSQL function inline_code_block line 1 at SQL statement > > > Best regards, Indeed, vacuum is going to be the biggest offender here, sadly. One could work around this of course (on top of my head, using notify to wake- up another client that would launch the required vacuums…) Being able to do transactions in DO blocks is a great new feature of v11 I was not aware of. But psql saw the addition of \if recently, so why not having loops in there too ? (Something better than this hack of course, it was just a 10 minutes hack-sprint for a demo) Regards Pierre
В списке pgsql-hackers по дате отправления
От: Markus Winand
Дата: