Re: proposal: set GUC variables for single query - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: proposal: set GUC variables for single query
Date
Msg-id m2vcrofzrf.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: proposal: set GUC variables for single query  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: set GUC variables for single query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> That looks pretty non-future-proof to me.  WITH is a SQL-standard
> syntax, it's not an extension that we control.

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; 

So maybe what we need is to only change the is_local parameter to the
function set_config() so that we can have the setting last for only the
current statement?

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: set GUC variables for single query
Next
From: Tom Lane
Date:
Subject: Re: proposal: set GUC variables for single query