From ad86d159b6ab90b195b06fb5c7b593900a7f9cd8 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 29 Nov 2022 09:39:36 +0100 Subject: Add 'missing_ok' argument to build_attrmap_by_name When it's given as true, return a 0 in the position of the missing column rather than raising an error. This is currently unused, but it allows us to reimplement column permission checking in a subsequent commit. It seems worth breaking into a separate commit because it affects unrelated code. Author: Amit Langote Discussion: https://postgr.es/m/CA+HiwqFfiai=qBxPDTjaio_ZcaqUKh+FC=prESrB8ogZgFNNNQ@mail.gmail.com --- src/backend/parser/parse_utilcmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/parser/parse_utilcmd.c') diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 487eb2041be..36791d88179 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -1232,7 +1232,8 @@ expandTableLikeClause(RangeVar *heapRel, TableLikeClause *table_like_clause) * have a failure since both tables are locked. */ attmap = build_attrmap_by_name(RelationGetDescr(childrel), - tupleDesc); + tupleDesc, + false); /* * Process defaults, if required. -- cgit v1.2.3