Re: Improving contrib/tablefunc's error reporting

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improving contrib/tablefunc's error reporting
Date: 2024-03-05 22:16:49
Message-ID: 7f8a4a70-7f73-48d2-8913-d0ce6d42cef6@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/5/24 17:04, Tom Lane wrote:
> After reading the thread at [1], I could not escape the feeling
> that contrib/tablefunc's error reporting is very confusing.
> Looking into the source code, I soon found that it is also
> very inconsistent, with similar error reports being phrased
> quite differently. The terminology for column names doesn't
> match the SGML docs either. And there are some places that are
> so confused about whether they are complaining about the calling
> query or the called query that the output is flat-out backwards.
> So at that point my nascent OCD wouldn't let me rest without
> fixing it. Here's a quick patch series to do that.
>
> For review purposes, I split this into two patches. 0001 simply
> adds some more test cases to reach currently-unexercised error
> reports. Then 0002 makes my proposed code changes and shows
> how the existing error messages change.
>
> I'm not necessarily wedded to the phrasings I used here,
> in case anyone has better ideas.
>
> BTW, while I didn't touch it here, it seems fairly bogus that
> connectby() checks both type OID and typmod for its output
> columns while crosstab() only checks type OID. I think
> crosstab() is in the wrong and needs to be checking typmod.
> That might be fit material for a separate patch though.

Been a long time since I gave contrib/tablefunc any love I guess ;-)

I will have a look at your patches, and the other issue you mention, but
it might be a day or three before I can give it some quality time.

--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2024-03-05 22:18:32 Re: Popcount optimization using AVX512
Previous Message Tom Lane 2024-03-05 22:04:55 Improving contrib/tablefunc's error reporting