Re: proposal: set GUC variables for single query

Поиск
Список
Период
Сортировка
От Jan Urbański
Тема Re: proposal: set GUC variables for single query
Дата
Msg-id 4E9AFED2.5070200@wulczer.org
обсуждение исходный текст
Ответ на Re: proposal: set GUC variables for single query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 16/10/11 17:49, Tom Lane wrote:
> 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.
> 
> Doesn't SET LOCAL cover this use-case pretty well already?

It does to a certain degree. If you have a bunch of statements in a
transaction and want to execute one of them with a different timezone
setting, you have to do the SET/RESET dance. In theory you should also
first grab the current value to set it back afterwards, in case someone
else did SET LOCAL before you, but I'll admin that's far-fetched.

The main use case would be apps running behing pgbouncer and using
statement pooling, and plain convenience.

I'd find it useful myself, but for now I'm making do with SET LOCAL and
it works fine. I'm bringing it up because it appears in the TODO created
at the PL Summit:

* Further discussion of per-statement config parameters for things
like timezone - Jan Urbanski

Tryin' to do my bit and all ;)

Jan


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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: proposal: set GUC variables for single query
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: Pushing ScalarArrayOpExpr support into the btree index AM