1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Arrange for SET LOCAL's effects to persist until the end of the current top

transaction, unless rolled back or overridden by a SET clause for the same
variable attached to a surrounding function call.  Per discussion, these
seem the best semantics.  Note that this is an INCOMPATIBLE CHANGE: in 8.0
through 8.2, SET LOCAL's effects disappeared at subtransaction commit
(leading to behavior that made little sense at the SQL level).

I took advantage of the opportunity to rewrite and simplify the GUC variable
save/restore logic a little bit.  The old idea of a "tentative" value is gone;
it was a hangover from before we had a stack.  Also, we no longer need a stack
entry for every nesting level, but only for those in which a variable's value
actually changed.
This commit is contained in:
Tom Lane
2007-09-11 00:06:42 +00:00
parent b366562e43
commit 82a47982f3
16 changed files with 814 additions and 510 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.163 2007/09/03 00:39:18 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.164 2007/09/11 00:06:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -453,7 +453,7 @@ InitializeSessionUserId(const char *rolename)
* right to insert an option into pg_authid was checked when it was
* inserted.
*/
ProcessGUCArray(a, PGC_SUSET, PGC_S_USER, false);
ProcessGUCArray(a, PGC_SUSET, PGC_S_USER, GUC_ACTION_SET);
}
ReleaseSysCache(roleTup);