diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-14 22:48:25 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-14 22:48:25 +0000 |
commit | 20ab467d76d78271006818d2baf4c9c8658d1f38 (patch) | |
tree | 7a536111b5cc4e494ac75558aad5655dfc8ab964 /src/backend/nodes/copyfuncs.c | |
parent | 48fb696753e267447f99914c7968d0b4ffb5c5dc (diff) | |
download | postgresql-20ab467d76d78271006818d2baf4c9c8658d1f38.tar.gz postgresql-20ab467d76d78271006818d2baf4c9c8658d1f38.zip |
Improve parser so that we can show an error cursor position for errors
during parse analysis, not only errors detected in the flex/bison stages.
This is per my earlier proposal. This commit includes all the basic
infrastructure, but locations are only tracked and reported for errors
involving column references, function calls, and operators. More could
be done later but this seems like a good set to start with. I've also
moved the ReportSyntaxErrorPosition logic out of psql and into libpq,
which should make it available to more people --- even within psql this
is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index f37daaf3a6f..b38efcdec8b 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.329 2006/03/05 15:58:27 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.330 2006/03/14 22:48:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1418,6 +1418,7 @@ _copyAExpr(A_Expr *from) COPY_NODE_FIELD(name); COPY_NODE_FIELD(lexpr); COPY_NODE_FIELD(rexpr); + COPY_SCALAR_FIELD(location); return newnode; } @@ -1428,6 +1429,7 @@ _copyColumnRef(ColumnRef *from) ColumnRef *newnode = makeNode(ColumnRef); COPY_NODE_FIELD(fields); + COPY_SCALAR_FIELD(location); return newnode; } @@ -1482,6 +1484,7 @@ _copyFuncCall(FuncCall *from) COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(agg_star); COPY_SCALAR_FIELD(agg_distinct); + COPY_SCALAR_FIELD(location); return newnode; } @@ -1532,6 +1535,7 @@ _copyTypeName(TypeName *from) COPY_SCALAR_FIELD(pct_type); COPY_SCALAR_FIELD(typmod); COPY_NODE_FIELD(arrayBounds); + COPY_SCALAR_FIELD(location); return newnode; } |