Re: proposal: set GUC variables for single query

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: proposal: set GUC variables for single query
Дата
Msg-id m24nz8hiv6.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на proposal: set GUC variables for single query  (Jan Urbański <wulczer@wulczer.org>)
Ответы Re: proposal: set GUC variables for single query
Список pgsql-hackers
Jan Urbański <wulczer@wulczer.org> writes:
> this idea has cropped up last PGCon - the ability to set GUC variables
> for the duration of a single query. It would work by setting the GUCs
> for the duration of the query and setting them back to what they were
> after it has terminated. By "setting them back" I mean respecting the
> previously set values, regardless of their source (set in run-time,
> per-role settings, postgresql.conf settings).

+1 on the use case, allowing to do that in the statement itself would be
a nice convenience.

> It mostly falls into the realm of syntax sugar, but as more than one
> person felt it's a good idea, I thought I'd float it around here.
>
> I poked a little bit at the grammar to see where could it fit and didn't
> have much success of doing it without a new reserved keyword. Supposing
> the idea gets some traction, any suggestions for the syntax?

I think it would fit quite well within our extending of the WITH syntax.

WITH work_mem = '1GB', timezone = 'Europe/Amsterdam', foo AS (   SELECT something
)
SELECT toplevel FROM foo;

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


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

Предыдущее
От: Florian Pflug
Дата:
Сообщение: Re: Underspecified window queries in regression tests
Следующее
От: Tom Lane
Дата:
Сообщение: Re: (patch) regression diffs on collate.linux.utf8 test