Re: Some quick notes about extending libpq for new protocol

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

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> 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?

That still works with respect to libpq's internally-generated errors,
which is as far as I know the only case that the concatenation was
actually useful for.

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

Yes, it is. The question here is what the backwards-compatible
PQerrorMessage() call should produce. Do you think position should
get left out of that? My thought was that the "terse" form should
carry everything that is likely to fit on one line, and position
would usually fit on the same line with "syntax error". Also, an app
that is using PQerrorMessage() rather than constructing its own
error message from the individual fields is likely not gonna do anything
as helpful as highlighting ...

> 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)?

The backwards-compatible part *is* that PQerrorMessage() returns text
with a trailing newline. If you fetch the individual fields, they don't
have trailing newlines.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Benjamin Minshall 2003-06-16 15:24:47 Multi Table Indexes
Previous Message Peter Eisentraut 2003-06-16 14:51:16 Re: Some quick notes about extending libpq for new

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jan Wieck 2003-06-16 17:35:08 Re: Info
Previous Message Peter Eisentraut 2003-06-16 14:51:16 Re: Some quick notes about extending libpq for new