1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Support SET FROM CURRENT in CREATE/ALTER FUNCTION, ALTER DATABASE, ALTER ROLE.

(Actually, it works as a plain statement too, but I didn't document that
because it seems a bit useless.)  Unify VariableResetStmt with
VariableSetStmt, and clean up some ancient cruft in the representation of
same.
This commit is contained in:
Tom Lane
2007-09-03 18:46:30 +00:00
parent dd4594e332
commit e7889b83b7
17 changed files with 382 additions and 360 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.381 2007/08/31 01:44:05 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.382 2007/09/03 18:46:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2525,8 +2525,7 @@ _copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
COPY_STRING_FIELD(dbname);
COPY_STRING_FIELD(variable);
COPY_NODE_FIELD(value);
COPY_NODE_FIELD(setstmt);
return newnode;
}
@ -2597,6 +2596,7 @@ _copyVariableSetStmt(VariableSetStmt *from)
{
VariableSetStmt *newnode = makeNode(VariableSetStmt);
COPY_SCALAR_FIELD(kind);
COPY_STRING_FIELD(name);
COPY_NODE_FIELD(args);
COPY_SCALAR_FIELD(is_local);
@ -2614,16 +2614,6 @@ _copyVariableShowStmt(VariableShowStmt *from)
return newnode;
}
static VariableResetStmt *
_copyVariableResetStmt(VariableResetStmt *from)
{
VariableResetStmt *newnode = makeNode(VariableResetStmt);
COPY_STRING_FIELD(name);
return newnode;
}
static DiscardStmt *
_copyDiscardStmt(DiscardStmt *from)
{
@ -2746,8 +2736,7 @@ _copyAlterRoleSetStmt(AlterRoleSetStmt *from)
AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
COPY_STRING_FIELD(role);
COPY_STRING_FIELD(variable);
COPY_NODE_FIELD(value);
COPY_NODE_FIELD(setstmt);
return newnode;
}
@ -3428,9 +3417,6 @@ copyObject(void *from)
case T_VariableShowStmt:
retval = _copyVariableShowStmt(from);
break;
case T_VariableResetStmt:
retval = _copyVariableResetStmt(from);
break;
case T_DiscardStmt:
retval = _copyDiscardStmt(from);
break;