mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +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:
@ -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