summaryrefslogtreecommitdiff
path: root/src/backend/nodes/nodeFuncs.c
diff options
context:
space:
mode:
authorTom Lane2008-09-01 20:42:46 +0000
committerTom Lane2008-09-01 20:42:46 +0000
commitb153c0920960a6059b67969469166fb29c0105d7 (patch)
tree4e7100ecdca88746c369ae2a6a43468925f3194d /src/backend/nodes/nodeFuncs.c
parent9ac4299163247645c6e391f5f65735c6cb78ccb9 (diff)
Add a bunch of new error location reports to parse-analysis error messages.
There are still some weak spots around JOIN USING and relation alias lists, but most errors reported within backend/parser/ now have locations.
Diffstat (limited to 'src/backend/nodes/nodeFuncs.c')
-rw-r--r--src/backend/nodes/nodeFuncs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
index fa1bb347b90..a0616415666 100644
--- a/src/backend/nodes/nodeFuncs.c
+++ b/src/backend/nodes/nodeFuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.31 2008/08/28 23:09:46 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.32 2008/09/01 20:42:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -613,6 +613,9 @@ exprLocation(Node *expr)
return -1;
switch (nodeTag(expr))
{
+ case T_RangeVar:
+ loc = ((RangeVar *) expr)->location;
+ break;
case T_Var:
loc = ((Var *) expr)->location;
break;
@@ -789,6 +792,10 @@ exprLocation(Node *expr)
/* just use argument's location */
loc = exprLocation((Node *) ((TargetEntry *) expr)->expr);
break;
+ case T_IntoClause:
+ /* use the contained RangeVar's location --- close enough */
+ loc = exprLocation((Node *) ((IntoClause *) expr)->rel);
+ break;
case T_List:
{
/* report location of first list member that has a location */
@@ -852,6 +859,10 @@ exprLocation(Node *expr)
loc = leftmostLoc(loc, tc->location);
}
break;
+ case T_SortBy:
+ /* just use argument's location (ignore operator, if any) */
+ loc = exprLocation(((SortBy *) expr)->node);
+ break;
case T_TypeName:
loc = ((TypeName *) expr)->location;
break;