diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-28 23:09:48 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-28 23:09:48 +0000 |
| commit | a2794623d292f7bbfe3134d1407281055acce584 (patch) | |
| tree | 106758200708577aaac72ed926f0f4faa3cda36c /src/backend/optimizer/prep/prepunion.c | |
| parent | 6734182c169a1ecb74dd8495004e896ee4519adb (diff) | |
| download | postgresql-a2794623d292f7bbfe3134d1407281055acce584.tar.gz | |
Extend the parser location infrastructure to include a location field in
most node types used in expression trees (both before and after parse
analysis). This allows us to place an error cursor in many situations
where we formerly could not, because the information wasn't available
beyond the very first level of parse analysis. There's a fair amount
of work still to be done to persuade individual ereport() calls to actually
include an error location, but this gets the initdb-forcing part of the
work out of the way; and the situation is already markedly better than
before for complaints about unimplementable implicit casts, such as
CASE and UNION constructs with incompatible alternative data types.
Per my proposal of a few days ago.
Diffstat (limited to 'src/backend/optimizer/prep/prepunion.c')
| -rw-r--r-- | src/backend/optimizer/prep/prepunion.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index c07ca4434a..7dc274797e 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -22,7 +22,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.154 2008/08/25 22:42:33 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.155 2008/08/28 23:09:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1410,6 +1410,7 @@ adjust_appendrel_attrs_mutator(Node *node, AppendRelInfo *context) r->arg = (Expr *) var; r->resulttype = context->parent_reltype; r->convertformat = COERCE_IMPLICIT_CAST; + r->location = -1; /* Make sure the Var node has the right type ID, too */ var->vartype = context->child_reltype; return (Node *) r; @@ -1428,6 +1429,8 @@ adjust_appendrel_attrs_mutator(Node *node, AppendRelInfo *context) rowexpr->args = fields; rowexpr->row_typeid = var->vartype; rowexpr->row_format = COERCE_IMPLICIT_CAST; + rowexpr->location = -1; + return (Node *) rowexpr; } } |
