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

From Tom Lane
Subject Re: proposal: set GUC variables for single query
Date
Msg-id 21047.1318813170@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal: set GUC variables for single query  (Robert Haas <robertmhaas@gmail.com>)
Responses 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>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: proposal: set GUC variables for single query
Next
From: Andrew Dunstan
Date:
Subject: Re: proposal: set GUC variables for single query