mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
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.
This commit is contained in:
contrib/earthdistance/expected
src
backend
access
common
catalog
commands
aggregatecmds.ccomment.cdefine.cfunctioncmds.copclasscmds.coperatorcmds.cschemacmds.csequence.ctablecmds.ctypecmds.cview.c
executor
nodes
optimizer
parser
analyze.cgram.yparse_clause.cparse_expr.cparse_func.cparse_node.cparse_oper.cparse_relation.cparse_target.cparse_type.cscan.l
tcop
utils
adt
bin
psql
include
nodes
parser
tcop
interfaces
pl
test
regress
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.28 2006/03/05 15:58:24 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.29 2006/03/14 22:48:18 tgl Exp $
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The "DefineFoo" routines take the parse tree and pick out the
|
||||
@ -152,9 +152,9 @@ DefineOperator(List *names, List *parameters)
|
||||
|
||||
/* Transform type names to type OIDs */
|
||||
if (typeName1)
|
||||
typeId1 = typenameTypeId(typeName1);
|
||||
typeId1 = typenameTypeId(NULL, typeName1);
|
||||
if (typeName2)
|
||||
typeId2 = typenameTypeId(typeName2);
|
||||
typeId2 = typenameTypeId(NULL, typeName2);
|
||||
|
||||
/*
|
||||
* If any of the mergejoin support operators were given, then canMerge is
|
||||
@ -210,8 +210,9 @@ RemoveOperator(RemoveOperStmt *stmt)
|
||||
HeapTuple tup;
|
||||
ObjectAddress object;
|
||||
|
||||
operOid = LookupOperNameTypeNames(operatorName, typeName1, typeName2,
|
||||
false);
|
||||
operOid = LookupOperNameTypeNames(NULL, operatorName,
|
||||
typeName1, typeName2,
|
||||
false, -1);
|
||||
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
@ -286,8 +287,9 @@ AlterOperatorOwner(List *name, TypeName *typeName1, TypeName *typeName2,
|
||||
|
||||
rel = heap_open(OperatorRelationId, RowExclusiveLock);
|
||||
|
||||
operOid = LookupOperNameTypeNames(name, typeName1, typeName2,
|
||||
false);
|
||||
operOid = LookupOperNameTypeNames(NULL, name,
|
||||
typeName1, typeName2,
|
||||
false, -1);
|
||||
|
||||
AlterOperatorOwner_internal(rel, operOid, newOwnerId);
|
||||
|
||||
|
Reference in New Issue
Block a user