Re: proposal: set GUC variables for single query
От
Jan Urbański
Тема
Re: proposal: set GUC variables for single query
Дата
Msg-id
4E9BEC83.5070603@wulczer.org
Ответ на
Re: proposal: set GUC variables for single query (Robert Haas)
Список
Дерево обсуждения
proposal: set GUC variables for single query Jan Urbański <wulczer@wulczer.org>
Re: proposal: set GUC variables for single query Tom Lane <tgl@sss.pgh.pa.us>
Re: proposal: set GUC variables for single query Jan Urbański <wulczer@wulczer.org>
Re: proposal: set GUC variables for single query Thom Brown <thom@linux.com>
Re: proposal: set GUC variables for single query Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Re: proposal: set GUC variables for single query Tom Lane <tgl@sss.pgh.pa.us>
Re: proposal: set GUC variables for single query Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Re: proposal: set GUC variables for single query Tom Lane <tgl@sss.pgh.pa.us>
Re: proposal: set GUC variables for single query Robert Haas <robertmhaas@gmail.com>
Re: proposal: set GUC variables for single query Tom Lane <tgl@sss.pgh.pa.us>
Re: proposal: set GUC variables for single query Andrew Dunstan <andrew@dunslane.net>
Re: proposal: set GUC variables for single query Robert Haas <robertmhaas@gmail.com>
Re: proposal: set GUC variables for single query Jan Urbański <wulczer@wulczer.org>
Re: proposal: set GUC variables for single query Tom Lane <tgl@sss.pgh.pa.us>
On 17/10/11 02:53, Robert Haas wrote:
> On Sun, Oct 16, 2011 at 4:58 PM, Tom Lane wrote:
>> Dimitri Fontaine writes:
>>> Now that you mention it, the following might actually already work:
>>
>>> WITH settings AS (
>>> SELECT set_config('timezone', 'Europe/Amsterdam', t),
>>> set_config('work_mem', '1 GB', t)
>>> ),
>>> foo AS (
>>> SELECT …
>>> )
>>> INSERT INTO bar SELECT * FROM foo;
>>
>> Only for small values of "work" ... you won't be able to affect planner
>> settings that way, nor can you assume that that WITH item is executed
>> before all else. See recent thread pointing out that setting values
>> mid-query is unsafe.
>
> I previously floated the idea of using a new keyword, possibly LET,
> for this, like this:
>
> LET var = value [, ...] IN query
LET was something I thought about, although you'd have to use something
like parenthesis around the GUC assignements because "value" can contain
commas, leading to shift/reduce conflicts (that sucks, unfortunately).
But before whipping out the paint bucket I wanted to see if there's
enough buy-in to justify rehashing the syntax details.
Cheers,
Jan
В списке pgsql-hackers по дате отправления
От: Yeb Havinga
Дата: