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

From: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add schema-qualified relnames in constraint error messages.
Date: 2016-03-14 10:58:32
Message-ID: CACACo5RNXQw-r0XNEH7npSj_bQhGJ23PmEX+VxTyr4qq2L_A5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 10, 2016 at 12:33 AM, Daniel Verite <daniel(at)manitou-mail(dot)org>
wrote:

> Shulgin, Oleksandr wrote:
>
> > Most importantly, I'd like to learn of better options than storing the
> > whole last_result in psql's pset structure.
>
> I guess that you could, each time a query fails, gather silently the
> result of \errverbose, store it in a buffer, discard the PGresult,
> and in case the user does \errverbose before running another query,
> output what was in that buffer.
>

That's a neat idea. I also think that we could only store last PGresult
when the query fails actually and discard it otherwise: the PGresult
holding only the error doesn't occupy too much space.

What I dislike about this POC is all the disruption in libpq, to be
honest. 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.

--
Alex

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-03-14 11:04:48 Re: [PROPOSAL] VACUUM Progress Checker.
Previous Message Ashutosh Bapat 2016-03-14 10:39:50 Re: Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat