Re: proposal: set GUC variables for single query

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Jan Urbański <wulczer(at)wulczer(dot)org>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: set GUC variables for single query
Date: 2011-10-17 01:12:41
Message-ID: 4E9B8109.5010902@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/16/2011 08:59 PM, Tom Lane wrote:
> Robert Haas<robertmhaas(at)gmail(dot)com> writes:
>> I previously floated the idea of using a new keyword, possibly LET,
>> for this, like this:
>> LET var = value [, ...] IN query
>> I'm not sure if anyone bought it, but I'll run it up the flagpole
>> again and see if anyone salutes. I tend to agree with the idea that
>> SET LOCAL isn't always what you want; per-transaction is not the same
>> as per-query, and multi-command query strings have funny semantics,
>> and multiple server round-trips are frequently undesirable; and it
>> just seems cleaner, at least IMHO.
> Well, syntax aside, the real issue here is that GUC doesn't have
> any notion of a statement-lifespan setting, and adding one would require
> adding per-statement overhead; not to mention possibly adding
> considerable logical complexity, depending on exactly what you wanted to
> define as a "statement". I don't think an adequate case has been
> made that SET LOCAL is insufficient.
>
>

I agree. But if we are going to go there I vastly prefer Robert's
suggestion of a separate syntactical structure. Mixing this up with WITH
would just be an awful mess, and cause endless confusion.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-10-17 01:21:54 Re: proposal: set GUC variables for single query
Previous Message Tom Lane 2011-10-17 00:59:30 Re: proposal: set GUC variables for single query