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