Re: Add schema-qualified relnames in constraint error messages.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add schema-qualified relnames in constraint error messages.
Date: 2016-03-14 18:55:54
Message-ID: 9793.1457981754@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-14 19:10:13 Upcoming back-branch releases
Previous Message Robert Haas 2016-03-14 18:51:47 Re: Prepared Statement support for Parallel query