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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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