pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.
5+ messages / 1 participants
[nested] [flat]

* pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.
@ 2024-07-13 15:11 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2024-07-13 15:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't lose partitioned table reltuples=0 after relhassubclass=f.

ANALYZE sets relhassubclass=f when a partitioned table no longer has
partitions.  An ANALYZE doing that proceeded to apply the inplace update
of pg_class.reltuples to the old pg_class tuple instead of the new
tuple, losing that reltuples=0 change if the ANALYZE committed.
Non-partitioning inheritance trees were unaffected.  Back-patch to v14,
where commit 375aed36ad83f0e021e9bdd3a0034c0c992c66dc introduced
maintenance of partitioned table pg_class.reltuples.

Reported by Alexander Lakhin.

Discussion: https://postgr.es/m/a295b499-dcab-6a99-c06e-01cf60593344@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7102070329d8147246d2791321f9915c3b5abf31

Modified Files
--------------
src/backend/commands/analyze.c       |  7 +++++-
src/test/regress/expected/vacuum.out | 47 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 29 ++++++++++++++++++++++
3 files changed, 82 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.
@ 2024-07-13 15:11 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2024-07-13 15:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't lose partitioned table reltuples=0 after relhassubclass=f.

ANALYZE sets relhassubclass=f when a partitioned table no longer has
partitions.  An ANALYZE doing that proceeded to apply the inplace update
of pg_class.reltuples to the old pg_class tuple instead of the new
tuple, losing that reltuples=0 change if the ANALYZE committed.
Non-partitioning inheritance trees were unaffected.  Back-patch to v14,
where commit 375aed36ad83f0e021e9bdd3a0034c0c992c66dc introduced
maintenance of partitioned table pg_class.reltuples.

Reported by Alexander Lakhin.

Discussion: https://postgr.es/m/a295b499-dcab-6a99-c06e-01cf60593344@gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f5bb46fb2e65f951fe22c166756dab9743b33a8a

Modified Files
--------------
src/backend/commands/analyze.c       |  7 +++++-
src/test/regress/expected/vacuum.out | 47 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 29 ++++++++++++++++++++++
3 files changed, 82 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.
@ 2024-07-13 15:11 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2024-07-13 15:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't lose partitioned table reltuples=0 after relhassubclass=f.

ANALYZE sets relhassubclass=f when a partitioned table no longer has
partitions.  An ANALYZE doing that proceeded to apply the inplace update
of pg_class.reltuples to the old pg_class tuple instead of the new
tuple, losing that reltuples=0 change if the ANALYZE committed.
Non-partitioning inheritance trees were unaffected.  Back-patch to v14,
where commit 375aed36ad83f0e021e9bdd3a0034c0c992c66dc introduced
maintenance of partitioned table pg_class.reltuples.

Reported by Alexander Lakhin.

Discussion: https://postgr.es/m/a295b499-dcab-6a99-c06e-01cf60593344@gmail.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e81deeefcac2a0de06f51e82405f63935f00e2bc

Modified Files
--------------
src/backend/commands/analyze.c       |  7 +++++-
src/test/regress/expected/vacuum.out | 47 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 29 ++++++++++++++++++++++
3 files changed, 82 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.
@ 2024-07-13 15:11 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2024-07-13 15:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't lose partitioned table reltuples=0 after relhassubclass=f.

ANALYZE sets relhassubclass=f when a partitioned table no longer has
partitions.  An ANALYZE doing that proceeded to apply the inplace update
of pg_class.reltuples to the old pg_class tuple instead of the new
tuple, losing that reltuples=0 change if the ANALYZE committed.
Non-partitioning inheritance trees were unaffected.  Back-patch to v14,
where commit 375aed36ad83f0e021e9bdd3a0034c0c992c66dc introduced
maintenance of partitioned table pg_class.reltuples.

Reported by Alexander Lakhin.

Discussion: https://postgr.es/m/a295b499-dcab-6a99-c06e-01cf60593344@gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2b4a2a79edd258e13a44601d17b44e9929abab14

Modified Files
--------------
src/backend/commands/analyze.c       |  7 +++++-
src/test/regress/expected/vacuum.out | 47 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 29 ++++++++++++++++++++++
3 files changed, 82 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.
@ 2024-07-13 15:11 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2024-07-13 15:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't lose partitioned table reltuples=0 after relhassubclass=f.

ANALYZE sets relhassubclass=f when a partitioned table no longer has
partitions.  An ANALYZE doing that proceeded to apply the inplace update
of pg_class.reltuples to the old pg_class tuple instead of the new
tuple, losing that reltuples=0 change if the ANALYZE committed.
Non-partitioning inheritance trees were unaffected.  Back-patch to v14,
where commit 375aed36ad83f0e021e9bdd3a0034c0c992c66dc introduced
maintenance of partitioned table pg_class.reltuples.

Reported by Alexander Lakhin.

Discussion: https://postgr.es/m/a295b499-dcab-6a99-c06e-01cf60593344@gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2b415e95a8a7ccb4fe9276e2ca453f4ae69466c1

Modified Files
--------------
src/backend/commands/analyze.c             |  7 ++++-
src/test/regress/expected/sanity_check.out |  2 ++
src/test/regress/expected/vacuum.out       | 47 ++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql            | 29 ++++++++++++++++++
4 files changed, 84 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-07-13 15:11 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-13 15:11 pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f. Noah Misch <noah@leadboat.com>
2024-07-13 15:11 pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f. Noah Misch <noah@leadboat.com>
2024-07-13 15:11 pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f. Noah Misch <noah@leadboat.com>
2024-07-13 15:11 pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f. Noah Misch <noah@leadboat.com>
2024-07-13 15:11 pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f. Noah Misch <noah@leadboat.com>

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