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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
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:18:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> It'd be better to allow ErrorResponse to carry multiple fields.

> That's the idea.  But I can hardly concatenate the error codes, can I?  I
> looks as though we need an API where all the messages (errors + notices)
> from each query cycle are collected and can be cycled through after
> completion.

One way to do this that wouldn't involve breaking the protocol is
to assign significance to linebreaks in an 'E' message's payload.
I think someone proposed this already:

	ERROR: blah blah
	CODE: 12345
	LOCATION: some/file.c line NNN

ie, lines starting with agreed-on keywords would be taken as conveying
specific fields.  An arrangement like this could still work with plain
concatenation of multiple errors.  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.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2001-06-06 15:21:41
Subject: Re: Strange error, probably WAL-related
Previous:From: rai lalitDate: 2001-06-06 15:14:14
Subject: Delete oid giving problems

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