From 6114040711affa2b0bcf47fa2791187daf8455fb Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 3 Dec 2020 11:35:20 +0100 Subject: [PATCH] Small code simplifications strVal() can be used in a couple of places instead of coding the same thing by hand. --- src/backend/foreign/foreign.c | 2 +- src/backend/parser/gram.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/foreign/foreign.c b/src/backend/foreign/foreign.c index 61e48ca3f87..3e79c852c17 100644 --- a/src/backend/foreign/foreign.c +++ b/src/backend/foreign/foreign.c @@ -544,7 +544,7 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options) nulls[0] = false; if (def->arg) { - values[1] = CStringGetTextDatum(((Value *) (def->arg))->val.str); + values[1] = CStringGetTextDatum(strVal(def->arg)); nulls[1] = false; } else diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 61f02360415..469de52bc29 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -13890,7 +13890,7 @@ func_expr_common_subexpr: * Convert SystemTypeName() to SystemFuncName() even though * at the moment they result in the same thing. */ - $$ = (Node *) makeFuncCall(SystemFuncName(((Value *) llast($5->names))->val.str), + $$ = (Node *) makeFuncCall(SystemFuncName(strVal(llast($5->names))), list_make1($3), COERCE_EXPLICIT_CALL, @1); -- 2.39.5