Re: Any reasons for 'DO' statement not returning result?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Any reasons for 'DO' statement not returning result?
Дата
Msg-id CAHyXU0wtExZDELhfG-ysB4fbLmOvnUzeqkvGfbm6gX8R2NK0ag@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Any reasons for 'DO' statement not returning result?  (Chris Travers <chris.travers@gmail.com>)
Ответы Re: Any reasons for 'DO' statement not returning result?  (Chris Travers <chris.travers@gmail.com>)
Список pgsql-general
On Sun, Aug 14, 2016 at 5:58 AM, Chris Travers <chris.travers@gmail.com> wrote:
>
> On Sun, Aug 14, 2016 at 12:13 PM, Xtra Coder <xtracoder@gmail.com> wrote:
>>
>> Thanks, I'm aware about ability to create temp functions, but this is
>> actually too much overhead - I mean unneeded boilerplate code, but it seems
>> in current state it is "the least evil" which I have to use.
>>
>> I think 'what i need' is support for following
>> - ability to switch session language from 'sql' to 'pl/pgsql'
>> - in that mode - ability to declare session-scope variables, 'DO' is just
>> not needed after that
>> - SELECTs not targeted into a variable - are written to client output
>> - (C) Merlin Moncure - "Ability to embed collection of statements in the
>> database under a name and invoke those statements via CALL <name>, which
>> does not automatically create a transaction and a snapshot (unlike
>> functions/DO)"
>>
>> All this seems to be a huge change which will definitely not appear any
>> time soon.
>
> I am willing to bet that DO $$ $$; blocks are neither planned nor
> parameterized.  And the planner needs to know what is to be returned.

The statements within a do block are absolutely planned and
parameterized.  There was some recent discussion with respect to not
planning statements except under certain conditions (in a loop
basically) to reduce memory consumption of long 'do' blocks.

merlin


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

Предыдущее
От: Ioana Danes
Дата:
Сообщение: Re: ERROR: MultiXactId XXXXX has not been created yet -- apparent wraparound
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Jsonb extraction very slow