1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-25 21:42:33 +03:00

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
This commit is contained in:
David Rowley 2024-10-30 01:38:42 +13:00
parent 84b8fccbe5
commit fcbd1bb661

View File

@ -47,7 +47,6 @@ DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace,
{ {
Oid viewOid; Oid viewOid;
LOCKMODE lockmode; LOCKMODE lockmode;
CreateStmt *createStmt = makeNode(CreateStmt);
List *attrList; List *attrList;
ListCell *t; ListCell *t;
@ -223,6 +222,7 @@ DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace,
} }
else else
{ {
CreateStmt *createStmt = makeNode(CreateStmt);
ObjectAddress address; ObjectAddress address;
/* /*