Re: Small bug on CREATE EXTENSION pgq...

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>
Cc: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Jerry Sievers <gsievers19(at)comcast(dot)net>
Subject: Re: Small bug on CREATE EXTENSION pgq...
Date: 2015-01-29 21:42:03
Message-ID: 54CAA92B.1010000@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/28/15 10:25 PM, Tom Lane wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
>> * David Johnston (david(dot)g(dot)johnston(at)gmail(dot)com) wrote:
>>> Fair enough but "reset" to what? I don't know the internal mechanics but
>>> if the session default is "warning" and a local change sets it to "notice"
>>> then an unconditional reset would not get us back to the intended value.
>
>> Yeah, we'd really want to reset it to "what it was before."
>
> An extension script runs as a single transaction, so SET LOCAL could've
> been used to accomplish the result without trashing the session-lifespan
> setting.
>
> I'm not sure whether or not there was good reason to be changing the
> setting at all, but it's entirely on the extension script's head that
> it didn't do this in a less invasive way.

+1

One thing I have wished for is something akin to SET LOCAL that reverts at the end of a subtransaction. Typically I only need to tweak something like client_min_messages for a single command, so I'd prefer to

SAVEPOINT old_setting;
SET LOCAL blah;
command;
RELEASE old_setting;
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-01-29 21:43:51 Re: File based Incremental backup v8
Previous Message Andrew Dunstan 2015-01-29 21:33:36 Re: jsonb, unicode escapes and escaped backslashes