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/outfuncs.c | |
| parent | 48fb696753e267447f99914c7968d0b4ffb5c5dc (diff) | |
| download | postgresql-20ab467d76d78271006818d2baf4c9c8658d1f38.tar.gz | |
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/outfuncs.c')
| -rw-r--r-- | src/backend/nodes/outfuncs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 7bb20628c6..ef87fedbc2 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.269 2006/03/05 15:58:27 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.270 2006/03/14 22:48:19 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -1400,6 +1400,7 @@ _outFuncCall(StringInfo str, FuncCall *node) WRITE_NODE_FIELD(args); WRITE_BOOL_FIELD(agg_star); WRITE_BOOL_FIELD(agg_distinct); + WRITE_INT_FIELD(location); } static void @@ -1449,6 +1450,7 @@ _outTypeName(StringInfo str, TypeName *node) WRITE_BOOL_FIELD(pct_type); WRITE_INT_FIELD(typmod); WRITE_NODE_FIELD(arrayBounds); + /* location is deliberately not stored */ } static void @@ -1648,6 +1650,7 @@ _outAExpr(StringInfo str, A_Expr *node) WRITE_NODE_FIELD(lexpr); WRITE_NODE_FIELD(rexpr); + WRITE_INT_FIELD(location); } static void @@ -1687,6 +1690,7 @@ _outColumnRef(StringInfo str, ColumnRef *node) WRITE_NODE_TYPE("COLUMNREF"); WRITE_NODE_FIELD(fields); + WRITE_INT_FIELD(location); } static void |
