Re: [HACKERS] Proposed macros for error fields

2003-08-14 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes:
 I propose to add the following macros for the fields of an error or notice
 message for use in libpq applications.

Where, in libpq-fe.h?

The proposed names look fine to me except for

 W PG_DIAG_STACK_TRACE

This seems overly specific to my eyes --- I'd suggest PG_DIAG_CONTEXT,
or maybe someone can suggest another possibility.  We don't promise to
provide a stack trace per se; there are already uses that don't
correspond to the user's idea of function nesting (for instance,
identifying the buffer associated with an I/O failure).

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[HACKERS] Proposed macros for error fields

2003-08-08 Thread Peter Eisentraut
I propose to add the following macros for the fields of an error or notice
message for use in libpq applications.  The names are modelled after the
ones that ODBC uses.  (Well, at least they are chosen not to collide in
case we want to continue on that track.)

S   PG_DIAG_SEVERITY
C   PG_DIAG_SQLSTATE
M   PG_DIAG_MESSAGE_PRIMARY
D   PG_DIAG_MESSAGE_DETAIL
H   PG_DIAG_MESSAGE_HINT
P   PG_DIAG_STATEMENT_POSITION
W   PG_DIAG_STACK_TRACE
F   PG_DIAG_SOURCE_FILE
L   PG_DIAG_SOURCE_LINE
R   PG_DIAG_SOURCE_FUNCTION

Comments?

-- 
Peter Eisentraut   [EMAIL PROTECTED]

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match