From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: 9.5 Create Function Set From Current taken at creation time?
Date: Tue, 9 Aug 2016 09:10:04 -0400
Message-ID: <8cee0868-4d5c-beab-ea5d-82b8158d6e6b@2ndquadrant.com> (raw)
In-Reply-To: <CAKFQuwa=PBrKeXKv1kukEY81J6LkVHo7yRE6yM+FO6Dv+4stcQ@mail.gmail.com>
References: <CAKFQuwa=PBrKeXKv1kukEY81J6LkVHo7yRE6yM+FO6Dv+4stcQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 8/8/16 5:46 PM, David G. Johnston wrote:
> """
> The SET clause causes the specified configuration parameter to be set to
> the specified value when the function is entered, and then restored to
> its prior value when the function exits. SET FROM CURRENT saves the
> session's current value of the parameter as the value to be applied when
> the function is entered.
> """
>
> https://www.postgresql.org/docs/current/static/sql-createfunction.html
>
> I expect the attached script to output "NOTICE: SP : thirdschema",
> instead it outputs "NOTICE: SP: otherschema"
I think the piece you are missing is that it saves the setting when the
function is created, not when it is run.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, david.g.johnston@gmail.com
Subject: Re: 9.5 Create Function Set From Current taken at creation time?
In-Reply-To: <8cee0868-4d5c-beab-ea5d-82b8158d6e6b@2ndquadrant.com>
References: <CAKFQuwa=PBrKeXKv1kukEY81J6LkVHo7yRE6yM+FO6Dv+4stcQ@mail.gmail.com> <8cee0868-4d5c-beab-ea5d-82b8158d6e6b@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox