Re: Add schema-qualified relnames in constraint error messages. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add schema-qualified relnames in constraint error messages.
Date
Msg-id 9793.1457981754@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add schema-qualified relnames in constraint error messages.  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Responses Re: Add schema-qualified relnames in constraint error messages.
List pgsql-hackers
"Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de> writes:
> What I dislike about this POC is all the disruption in libpq, to be
> honest.

Yeah, I don't much like that either.  But I don't think we can avoid
some refactoring there; as designed, conversion of an error message into
user-visible form is too tightly tied to receipt of the message.

> It would be much neater if we could form the verbose message every
> time and let the client decide where to cut it.  Maybe a bit "too clever"
> would be to put a \0 char between short message and it's verbose
> continuation.  The client could then reach the verbose part like this
> (assuming that libpq did put a verbose part there): msg + strlen(msg) + 1.

Blech :-(

Thinking about it, though, it seems to me that we could get away with
always performing both styles of conversion and sticking both strings
into the PGresult.  That would eat a little more space but not much.
Then we just need to add API to let the application get at both forms.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [patch] Proposal for \crosstabview in psql
Next
From: Tom Lane
Date:
Subject: Upcoming back-branch releases