Re: Some macros for error field codes

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Some macros for error field codes
Date: 2003-07-28 08:36:06
Message-ID: Pine.LNX.4.56.0307281029090.2256@krusty.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shridhar Daithankar 2003-07-28 08:59:36 Doubt w.r.t vacuum
Previous Message Philip Yarra 2003-07-28 08:02:18 Re: OSF build fixed