Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2021-05-06 21:28:36 +0000
committerAlvaro Herrera2021-05-06 21:28:36 +0000
commita288d94c91e345ebeb10ac30f247270c8c8e380a (patch)
tree02295829c424a004643e43981ed9389fe7c5c2ae
parent469116389e18dbf6be0bd555bc2055a26be91a48 (diff)
Remove redundant variable
Author: Amul Sul <sulamul@gmail.com> Reviewed-by: Jeevan Ladhe <jeevan.ladhe@enterprisedb.com> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/CAAJ_b94HaNcrPVREUuB9-qUn2uB+gfcoX3FG_Vx0S6aFse+yhw@mail.gmail.com
-rw-r--r--src/backend/parser/parse_utilcmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 9dd30370dae..6fae9a96872 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -176,7 +176,6 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
Oid namespaceid;
Oid existing_relid;
ParseCallbackState pcbstate;
- bool is_foreign_table = IsA(stmt, CreateForeignTableStmt);
/*
* We must not scribble on the passed-in CreateStmt, so copy it. (This is
@@ -333,8 +332,11 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
/*
* Postprocess check constraints.
+ *
+ * For regular tables all constraints can be marked valid immediately,
+ * because the table is new therefore empty. Not so for foreign tables.
*/
- transformCheckConstraints(&cxt, !is_foreign_table ? true : false);
+ transformCheckConstraints(&cxt, !cxt.isforeign);
/*
* Postprocess extended statistics.