mirror of
https://github.com/postgres/postgres.git
synced 2025-11-29 23:43:17 +03:00
Add a bunch of new error location reports to parse-analysis error messages.
There are still some weak spots around JOIN USING and relation alias lists, but most errors reported within backend/parser/ now have locations.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.281 2008/08/25 22:42:34 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.282 2008/09/01 20:42:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2713,8 +2713,7 @@ get_utility_query_def(Query *query, deparse_context *context)
|
||||
appendContextKeyword(context, "",
|
||||
0, PRETTYINDENT_STD, 1);
|
||||
appendStringInfo(buf, "NOTIFY %s",
|
||||
quote_qualified_identifier(stmt->relation->schemaname,
|
||||
stmt->relation->relname));
|
||||
quote_identifier(stmt->conditionname));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.205 2008/07/09 15:56:49 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.206 2008/09/01 20:42:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -879,6 +879,23 @@ internalerrquery(const char *query)
|
||||
return 0; /* return value does not matter */
|
||||
}
|
||||
|
||||
/*
|
||||
* geterrcode --- return the currently set SQLSTATE error code
|
||||
*
|
||||
* This is only intended for use in error callback subroutines, since there
|
||||
* is no other place outside elog.c where the concept is meaningful.
|
||||
*/
|
||||
int
|
||||
geterrcode(void)
|
||||
{
|
||||
ErrorData *edata = &errordata[errordata_stack_depth];
|
||||
|
||||
/* we don't bother incrementing recursion_depth */
|
||||
CHECK_STACK_DEPTH();
|
||||
|
||||
return edata->sqlerrcode;
|
||||
}
|
||||
|
||||
/*
|
||||
* geterrposition --- return the currently set error position (0 if none)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user