From: Alvaro Herrera Date: Thu, 6 May 2021 21:28:36 +0000 (-0400) Subject: Remove redundant variable X-Git-Tag: REL_14_BETA1~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a288d94c91e345ebeb10ac30f247270c8c8e380a;p=thirdparty%2Fpostgresql.git Remove redundant variable Author: Amul Sul Reviewed-by: Jeevan Ladhe Reviewed-by: Bharath Rupireddy Reviewed-by: Justin Pryzby Discussion: https://postgr.es/m/CAAJ_b94HaNcrPVREUuB9-qUn2uB+gfcoX3FG_Vx0S6aFse+yhw@mail.gmail.com --- 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.