From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve error cursor positions for problems with partition bound
Date: Wed, 23 Sep 2020 22:05:01 +0000
Message-ID: <E1kLCsn-0002a8-HF@gemulon.postgresql.org> (raw)
Improve error cursor positions for problems with partition bounds.
We failed to pass down the query string to check_new_partition_bound,
so that its attempts to provide error cursor positions were for naught;
one must have the query string to get parser_errposition to do anything.
Adjust its API to require a ParseState to be passed down.
Also, improve the logic inside check_new_partition_bound so that the
cursor points at the partition bound for the specific column causing
the issue, when one can be identified.
That part is also for naught if we can't determine the query position of
the column with the problem. Improve transformPartitionBoundValue so
that it makes sure that const-simplified partition expressions will be
properly labeled with positions. In passing, skip calling evaluate_expr
if the value is already a Const, which is surely the most common case.
Alexandra Wang, Ashwin Agrawal, Amit Langote; reviewed by Ashutosh Bapat
Discussion: https://postgr.es/m/CACiyaSopZoqssfMzgHk6fAkp01cL6vnqBdmTw2C5_KJaFR_aMg@mail.gmail.com
Discussion: https://postgr.es/m/CAJV4CdrZ5mKuaEsRSbLf2URQ3h6iMtKD=hik8MaF5WwdmC9uZw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6b2c4e59d016ea40c42fdc66367d6463e792c125
Modified Files
--------------
src/backend/commands/tablecmds.c | 16 +++--
src/backend/parser/parse_utilcmd.c | 53 ++++++++++-----
src/backend/partitioning/partbounds.c | 101 +++++++++++++++++++----------
src/include/partitioning/partbounds.h | 8 +--
src/test/regress/expected/alter_table.out | 10 +++
src/test/regress/expected/create_table.out | 30 +++++++++
6 files changed, 160 insertions(+), 58 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve error cursor positions for problems with partition bound
In-Reply-To: <E1kLCsn-0002a8-HF@gemulon.postgresql.org>
References: <E1kLCsn-0002a8-HF@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox