Re: verbose mode for pg_input_error_message? - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: verbose mode for pg_input_error_message?
Date
Msg-id 20230110234112.GA1471581@nathanxps13
Whole thread Raw
In response to Re: verbose mode for pg_input_error_message?  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: verbose mode for pg_input_error_message?
List pgsql-hackers
On Wed, Jan 04, 2023 at 04:18:59PM -0500, Andrew Dunstan wrote:
> On 2023-01-02 Mo 10:44, Tom Lane wrote:
>> 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.
> 
> OK, here's a patch along those lines.

My vote would be to redefine the existing pg_input_error_message() function
to return a record, but I recognize that this would inflate the patch quite
a bit due to all the existing uses in the tests.  If this is the only
argument against this approach, I'm happy to help with the patch.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: wal_compression = method:level
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Support % wildcard in extension upgrade filenames