| From: | Robert Haas <rhaas(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: pg_plan_advice: Disallow partition name without partition schema |
| Date: | 2026-09-17 01:16:43 |
| Message-ID: | E1x70jz-000000002O3-1ynr@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
pg_plan_advice: Disallow partition name without partition schema.
Up until now, pg_plan_advice has had a feature that allows an advice
target to mention a partition name but omit the partition schema;
that is, something like SEQ_SCAN(foo/bar) forces a sequential scan on
every child of table foo whose partition name is bar, regardless of
the schema in which bar appears. However, that feature turns out to
have a nasty design flaw: while advice enforcement handles this case
just fine, the advice feedback code doesn't know about it and will
mark such advice as "matched, failed" even when everything worked
perfectly. Unfortunately, there seems to be no simple code fix for
this problem.
Since the release of PostgreSQL 19 is imminent, take the conservative
course and revert this feature of pg_plan_advice. In other words,
require the partition schema whenever the partition name is present.
You must now write e.g. SEQ_SCAN(foo/public.bar) rather than just
SEQ_SCAN(foo/bar). This doesn't affect any cases where automatically
generated advice is supplied, since generated advice has always
included the partition schema anyway. Manually written advice will
have to conform to the new, stricter rule. For a later release, we
can consider whether to again relax this restriction in some way,
but now is not the time to design new things.
Reported-by: Noah Misch <noah(at)leadboat(dot)com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CA+TgmoYmXy-jiP5qDhqNEiYFEBzQsArO6O2d9E8szNZqi1bePQ@mail.gmail.com
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/3201ea8f171a552b1a12e6c602a70f25252ba1cf
Modified Files
--------------
contrib/pg_plan_advice/README | 10 ++--
contrib/pg_plan_advice/expected/join_order.out | 8 +--
contrib/pg_plan_advice/expected/partitionwise.out | 60 +----------------------
contrib/pg_plan_advice/expected/syntax.out | 21 +++-----
contrib/pg_plan_advice/pgpa_ast.c | 12 ++---
contrib/pg_plan_advice/pgpa_ast.h | 4 +-
contrib/pg_plan_advice/pgpa_identifier.c | 31 +++++-------
contrib/pg_plan_advice/pgpa_parser.y | 12 ++---
contrib/pg_plan_advice/pgpa_trove.c | 18 +++----
contrib/pg_plan_advice/sql/join_order.sql | 4 +-
contrib/pg_plan_advice/sql/partitionwise.sql | 7 +--
contrib/pg_plan_advice/sql/syntax.sql | 7 +--
doc/src/sgml/pgplanadvice.sgml | 9 ++--
13 files changed, 58 insertions(+), 145 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fujii Masao | 2026-09-17 03:36:34 | Re: pgsql: Revert online data checksum transitions |
| Previous Message | Daniel Gustafsson | 2026-09-16 19:00:10 | pgsql: Fix online checksums revert leftovers |