[HACKERS] Some macros for error field codes

2003-07-28 Thread Peter Eisentraut
Should we create some user-friendly macros for the error field codes?  I
have a feeling that PGXYZ_SQLSTATE may make for better code than just 'C'.

-- 
Peter Eisentraut   [EMAIL PROTECTED]

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] Some macros for error field codes

2003-07-28 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes:
 Should we create some user-friendly macros for the error field codes?  I
 have a feeling that PGXYZ_SQLSTATE may make for better code than just 'C'.

I just pushed the ERRCODE_ macros out into their own file.  How about
placing that file where client apps can include it directly?

Note though that I think client apps will want to test is this code in
this class about as often as they'll want to check for specific
codes.  We might need to provide some additional infrastructure to
handle that.

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] Some macros for error field codes

2003-07-28 Thread Peter Eisentraut
Tom Lane writes:

  Should we create some user-friendly macros for the error field codes?  I
  have a feeling that PGXYZ_SQLSTATE may make for better code than just 'C'.

 I just pushed the ERRCODE_ macros out into their own file.  How about
 placing that file where client apps can include it directly?

I was actually talking of the single-letter codes that are used on the
protocol layer to tag the different fields of an error or notice result.
That is, instead of

PQresultErrorField(result, 'M')

I'd rather use something like

PQresultErrorField(result, PGEF_MESSSAGE_TEXT)

I'm not actually eager to push out the wordy SQLSTATE macros to the
client, although some might argue for that.

-- 
Peter Eisentraut   [EMAIL PROTECTED]

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] Some macros for error field codes

2003-07-28 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes:
 Should we create some user-friendly macros for the error field codes?

 I was actually talking of the single-letter codes that are used on the
 protocol layer to tag the different fields of an error or notice result.

Oh, those things.  Sure, if you like, though it might be just namespace
clutter.

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]