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

Поиск
Список
Период
Сортировка
От Shulgin, Oleksandr
Тема Re: Add schema-qualified relnames in constraint error messages.
Дата
Msg-id CACACo5RNXQw-r0XNEH7npSj_bQhGJ23PmEX+VxTyr4qq2L_A5g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add schema-qualified relnames in constraint error messages.  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: Add schema-qualified relnames in constraint error messages.
Список pgsql-hackers
On Wed, Feb 10, 2016 at 12:33 AM, Daniel Verite <daniel@manitou-mail.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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat
Следующее
От: Amit Langote
Дата:
Сообщение: Re: [PROPOSAL] VACUUM Progress Checker.