1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

Implement function-local GUC parameter settings, as per recent discussion.

There are still some loose ends: I didn't do anything about the SET FROM
CURRENT idea yet, and it's not real clear whether we are happy with the
interaction of SET LOCAL with function-local settings.  The documentation
is a bit spartan, too.
This commit is contained in:
Tom Lane
2007-09-03 00:39:26 +00:00
parent fcfe801ab8
commit 2abae34a2e
23 changed files with 2583 additions and 2151 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.600 2007/08/22 05:13:50 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.601 2007/09/03 00:39:16 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -4270,6 +4270,16 @@ common_func_opt_item:
{
$$ = makeDefElem("rows", (Node *)$2);
}
| SET set_rest
{
/* we abuse the normal content of a DefElem here */
$$ = makeDefElem("set", (Node *)$2);
}
| VariableResetStmt
{
/* we abuse the normal content of a DefElem here */
$$ = makeDefElem("set", $1);
}
;
createfunc_opt_item:
@@ -4564,13 +4574,13 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6;
$$ = (Node *)n;
}
| ALTER FUNCTION func_name func_args RENAME TO name
| ALTER FUNCTION function_with_argtypes RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_FUNCTION;
n->object = $3;
n->objarg = extractArgTypes($4);
n->newname = $7;
n->object = $3->funcname;
n->objarg = $3->funcargs;
n->newname = $6;
$$ = (Node *)n;
}
| ALTER GROUP_P RoleId RENAME TO RoleId
@@ -4755,13 +4765,13 @@ AlterObjectSchemaStmt:
n->newschema = $6;
$$ = (Node *)n;
}
| ALTER FUNCTION func_name func_args SET SCHEMA name
| ALTER FUNCTION function_with_argtypes SET SCHEMA name
{
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
n->objectType = OBJECT_FUNCTION;
n->object = $3;
n->objarg = extractArgTypes($4);
n->newschema = $7;
n->object = $3->funcname;
n->objarg = $3->funcargs;
n->newschema = $6;
$$ = (Node *)n;
}
| ALTER SEQUENCE relation_expr SET SCHEMA name
@@ -4829,13 +4839,13 @@ AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleId
n->newowner = $6;
$$ = (Node *)n;
}
| ALTER FUNCTION func_name func_args OWNER TO RoleId
| ALTER FUNCTION function_with_argtypes OWNER TO RoleId
{
AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
n->objectType = OBJECT_FUNCTION;
n->object = $3;
n->objarg = extractArgTypes($4);
n->newowner = $7;
n->object = $3->funcname;
n->objarg = $3->funcargs;
n->newowner = $6;
$$ = (Node *)n;
}
| ALTER opt_procedural LANGUAGE name OWNER TO RoleId