Re: Some quick notes about extending libpq for new

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-interfaces(at)postgreSQL(dot)org, <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Some quick notes about extending libpq for new
Date: 2003-06-16 14:51:16
Message-ID: Pine.LNX.4.44.0306161602130.2751-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Tom Lane writes:

> * Access to individual fields of an error/notice result; also some setting to
> determine how verbose PQerrorMessage is
>
> char *PQerrorField(conn, char fieldcode)
> char *PQresultErrorField(const PGresult *res, char fieldcode)
>
> fieldcode is as per the protocol spec. NULL is returned if no such field in
> current result (this includes case where current result isn't an error).

In the old protocol there used to be support for more then one error
arriving, in which case they were concatenated. What is happening with
that?

> PQsetErrorVerbosity(conn, PQERRORS_TERSE/DEFAULT/VERBOSE)
>
> TERSE: single-line error (severity, primary text, and position only)

Shouldn't the position be available as a separate field, so client
programs can do their own highlighting or whatnot?

> DEFAULT: above plus any detail, hint, or context fields (backwards compatible)
> VERBOSE: all available data

One more thing: It has always annoyed me that PQerrorMessage() returns the
text with a trailing newline. Since we now redefined newlines to be
paragraph breaks, should this be changed (in a backward-compatible
fashion)?

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-06-16 15:13:42 Re: Some quick notes about extending libpq for new protocol
Previous Message Peter Eisentraut 2003-06-16 14:51:04 Re: 7.3.3 COMPILE FAILURE: pg_dump (fwd)

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-06-16 15:13:42 Re: Some quick notes about extending libpq for new protocol
Previous Message Tom Lane 2003-06-16 13:22:11 Re: ECPG CVS version problems