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