mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Support "OR condition ..." in plpgsql EXCEPTION clauses to make the syntax
more nearly Oracle-equivalent. Allow matching by category as well as specific error code. Document the set of available condition names (or more accurately, synchronize it with the existing documentation). In passing, update errcodes.sgml to include codes added during 7.5 development.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.71 2004/07/31 00:45:43 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.72 2004/07/31 23:04:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -61,6 +61,10 @@
|
||||
(PGSIXBIT(ch1) + (PGSIXBIT(ch2) << 6) + (PGSIXBIT(ch3) << 12) + \
|
||||
(PGSIXBIT(ch4) << 18) + (PGSIXBIT(ch5) << 24))
|
||||
|
||||
/* These macros depend on the fact that '0' becomes a zero in SIXBIT */
|
||||
#define ERRCODE_TO_CATEGORY(ec) ((ec) & ((1 << 12) - 1))
|
||||
#define ERRCODE_IS_CATEGORY(ec) (((ec) & ~((1 << 12) - 1)) == 0)
|
||||
|
||||
/* SQLSTATE codes for errors are defined in a separate file */
|
||||
#include "utils/errcodes.h"
|
||||
|
||||
|
Reference in New Issue
Block a user