Re: Report error position in partition bound check

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Alexandra Wang <lewang@pivotal.io>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>, Ashwin Agrawal <aagrawal@pivotal.io>
Date: 2020-04-09T01:11:03Z
Lists: pgsql-hackers
On Wed, Apr 08, 2020 at 05:15:57PM -0700, Alexandra Wang wrote:
> I have attached a patch to pass in a ParseState to
> check_new_partition_bound() to enable the reporting of the error
> position. Below is what the error message looks like before and after
> applying the patch.
> 
> Another option is to not pass the parser_errposition() argument at all
> to ereport() in this function, since the query is relatively short and
> the error message is already descriptive enough.

It depends on the complexity of the relation definition, so adding a
position looks like a good idea to me.  Anyway, even if this looks
like an oversight to me, we are post feature freeze for 13 and that's
an improvement, so this looks like material for PG14 to me.  Are there
more opinions on the matter?

Please note that you forgot to update the regression test output.
--
Michael

Commits

  1. Improve error cursor positions for problems with partition bounds.