aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2024-10-30 01:38:42 +1300
committerDavid Rowley <drowley@postgresql.org>2024-10-30 01:38:42 +1300
commitfcbd1bb6613fde5784b54c88e4d0398ab8e13694 (patch)
tree39ad8010932c2ed531c49eeec1ab1e7abf0f6969 /src
parent84b8fccbe5c21cc2a05f8cf91903cadc6ebfe680 (diff)
downloadpostgresql-fcbd1bb6613fde5784b54c88e4d0398ab8e13694.tar.gz
postgresql-fcbd1bb6613fde5784b54c88e4d0398ab8e13694.zip
Reduce variable scope and possibly useless palloc
Move the CreateStmt down to the branch that it's used in, thus preventing the makeNode() call in cases where the CreateStmt isn't used. Author: Ranier Vilela <ranier.vf@gmail.com> Discussion: https://postgr.es/m/CAEudQAq=06YPWPhS+yyTbCwv5JLKRz8rm3dWx6JR5Uj_d_fQDA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/view.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c
index fdad8338324..2bd49eb55e6 100644
--- a/src/backend/commands/view.c
+++ b/src/backend/commands/view.c
@@ -47,7 +47,6 @@ DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace,
{
Oid viewOid;
LOCKMODE lockmode;
- CreateStmt *createStmt = makeNode(CreateStmt);
List *attrList;
ListCell *t;
@@ -223,6 +222,7 @@ DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace,
}
else
{
+ CreateStmt *createStmt = makeNode(CreateStmt);
ObjectAddress address;
/*