From 89e51abcb2905d6beaa09a7d3603d6882ac27033 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 31 Oct 2024 15:53:58 -0400 Subject: Add a parse location field to struct FunctionParameter. This allows an error cursor to be supplied for a bunch of bad-function-definition errors that previously lacked one, or that cheated a bit by pointing at the contained type name when the error isn't really about that. Bump catversion from an abundance of caution --- I don't think this node type can actually appear in stored views/rules, but better safe than sorry. Jian He and Tom Lane (extracted from a larger patch by Jian, with some additional work by me) Discussion: https://postgr.es/m/CACJufxEmONE3P2En=jopZy1m=cCCUs65M4+1o52MW5og9oaUPA@mail.gmail.com --- src/backend/nodes/nodeFuncs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/backend/nodes/nodeFuncs.c') diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index f76072228c9..3060847b133 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -1723,8 +1723,7 @@ exprLocation(const Node *expr) loc = ((const Constraint *) expr)->location; break; case T_FunctionParameter: - /* just use typename's location */ - loc = exprLocation((Node *) ((const FunctionParameter *) expr)->argType); + loc = ((const FunctionParameter *) expr)->location; break; case T_XmlSerialize: /* XMLSERIALIZE keyword should always be the first thing */ -- cgit v1.2.3