From 20ab467d76d78271006818d2baf4c9c8658d1f38 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 14 Mar 2006 22:48:25 +0000 Subject: 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. --- src/backend/commands/aggregatecmds.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/backend/commands/aggregatecmds.c') diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index 99c7d531f91..3c0855238e2 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.32 2006/03/05 15:58:23 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.33 2006/03/14 22:48:18 tgl Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -129,9 +129,9 @@ DefineAggregate(List *names, List *parameters) if (pg_strcasecmp(TypeNameToString(baseType), "ANY") == 0) baseTypeId = ANYOID; else - baseTypeId = typenameTypeId(baseType); + baseTypeId = typenameTypeId(NULL, baseType); - transTypeId = typenameTypeId(transType); + transTypeId = typenameTypeId(NULL, transType); if (get_typtype(transTypeId) == 'p' && transTypeId != ANYARRAYOID && transTypeId != ANYELEMENTOID) @@ -176,7 +176,7 @@ RemoveAggregate(RemoveAggrStmt *stmt) * that the aggregate is to apply to all basetypes (eg, COUNT). */ if (aggType) - basetypeID = typenameTypeId(aggType); + basetypeID = typenameTypeId(NULL, aggType); else basetypeID = ANYOID; @@ -231,7 +231,7 @@ RenameAggregate(List *name, TypeName *basetype, const char *newname) * COUNT). */ if (basetype) - basetypeOid = typenameTypeId(basetype); + basetypeOid = typenameTypeId(NULL, basetype); else basetypeOid = ANYOID; @@ -311,7 +311,7 @@ AlterAggregateOwner(List *name, TypeName *basetype, Oid newOwnerId) * COUNT). */ if (basetype) - basetypeOid = typenameTypeId(basetype); + basetypeOid = typenameTypeId(NULL, basetype); else basetypeOid = ANYOID; -- cgit v1.2.3