Skip site navigation (1) Skip section navigation (2)

Re: Can the backend return more than one error message per PQexec?

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: Can the backend return more than one error message per PQexec?
Date: 2001-06-06 15:47:25
Message-ID: Pine.LNX.4.30.0106061734310.757-100000@peter.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane writes:

> One way to do this that wouldn't involve breaking the protocol is
> to assign significance to linebreaks in an 'E' message's payload.

Some fields may contain line breaks; for example, error messages
definitely do now.  We could pick a non-printing character (e.g., \001)
as the separator, but it might get ugly with multibyte.  Of course table
names and such things can contain these characters as well, but I guess
there wouldn't be so much resistance in changing that.  At worst we could
make up an escape mechanism.

> Also, it would work tolerably well when fed to an old application that
> knows nothing of the convention and just prints out the error string.
> I'm leery of defining a whole new API that must be used before one
> gets to see any of the added error information --- that would mean
> that a lot of people never will see it.

Okay, so PQerrorMessage will print the whole glob, whereas there would be
an accessor method that would filter out the fields.  That would also work
transparently with the notice processor, which I was concerned about until
now.  I like it.

-- 
Peter Eisentraut   peter_e(at)gmx(dot)net   http://funkturm.homeip.net/~peter


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-06-06 15:54:18
Subject: Re: Can the backend return more than one error message per PQexec?
Previous:From: KuroiNekoDate: 2001-06-06 15:45:58
Subject: Re: Max inserts / sec ... on any platform?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group