AW: More on elog and error codes
| От | Zeugswetter Andreas SB |
|---|---|
| Тема | AW: More on elog and error codes |
| Дата | |
| Msg-id | 11C1E6749A55D411A9670001FA687963368256@sdexcsrv1.f000.d0188.sd.spardat.at обсуждение исходный текст |
| Ответы |
Re: AW: More on elog and error codes
|
| Список | pgsql-hackers |
> #define PGERR_TYPE 1854
#define PGSQLSTATE_TYPE "S0021" // char(5) SQLSTATE
The standard calls this error variable SQLSTATE
(look up in ESQL standard)
first 2 chars are class next 3 are subclass
"00000" is e.g. Success
"02000" is Data not found
"U0xxx" user defined routine error xxx is user defined
> /* somewhere... */
>
> elogc(ERROR, PGERR_TYPE, "type %s cannot be created because it already exists", ...)
PGELOG(ERROR, PGSQLSTATE_TYPE, ("type %s cannot be created because it already exists", ...))
put varargs into parentheses to avoid need for ... macros see Tom's proposal
I also agree, that we can group different text messages into the same SQLSTATE,
if it seems appropriate for the client to handle them alike.
Andreas
В списке pgsql-hackers по дате отправления: