Re: verbose mode for pg_input_error_message?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: verbose mode for pg_input_error_message?
Date: 2023-01-02 15:44:42
Message-ID: 1430967.1672674282@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I've been wondering if it might be a good idea to have a third parameter
> for pg_input_error_message() which would default to false, but which if
> true would cause it to emit the detail and hint fields, if any, as well
> as the message field from the error_data.

I don't think that just concatenating those strings would make for a
pleasant API. More sensible, perhaps, to have a separate function
that returns a record. Or we could redefine the existing function
that way, but I suspect that "just the primary error" will be a
principal use-case.

Being able to get the SQLSTATE is likely to be interesting too.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-01-02 15:57:27 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
Previous Message Justin Pryzby 2023-01-02 15:42:40 Re: Allow placeholders in ALTER ROLE w/o superuser