pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix assorted syscache lookup sloppiness in partition-related cod
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix assorted syscache lookup sloppiness in partition-related cod
@ 2017-11-28 00:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-11-28 00:22 UTC (permalink / raw)
  To: pgsql-committers

Fix assorted syscache lookup sloppiness in partition-related code.

heap_drop_with_catalog and ATExecDetachPartition neglected to check for
SearchSysCache failures, as noted in bugs #14927 and #14928 from Pan Bian.
Such failures are pretty unlikely, since we should already have some sort
of lock on the rel at these points, but it's neither a good idea nor
per project style to omit a check for failure.

Also, StorePartitionKey contained a syscache lookup that it never did
anything with, including never releasing the result.  Presumably the
reason why we don't see refcount-leak complaints is that the lookup
always fails; but in any case it's pretty useless, so remove it.

All of these errors were evidently introduced by the relation
partitioning feature.  Back-patch to v10 where that came in.

Amit Langote and Tom Lane

Discussion: https://postgr.es/m/20171127090105.1463.3962@wrigleys.postgresql.org
Discussion: https://postgr.es/m/20171127091341.1468.72696@wrigleys.postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/64487044966d6246052ff974f0ce98cac5a0c79b

Modified Files
--------------
src/backend/catalog/heap.c       | 5 ++---
src/backend/commands/tablecmds.c | 3 +++
2 files changed, 5 insertions(+), 3 deletions(-)



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

* pgsql: Fix assorted syscache lookup sloppiness in partition-related cod
@ 2017-11-28 00:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-11-28 00:22 UTC (permalink / raw)
  To: pgsql-committers

Fix assorted syscache lookup sloppiness in partition-related code.

heap_drop_with_catalog and ATExecDetachPartition neglected to check for
SearchSysCache failures, as noted in bugs #14927 and #14928 from Pan Bian.
Such failures are pretty unlikely, since we should already have some sort
of lock on the rel at these points, but it's neither a good idea nor
per project style to omit a check for failure.

Also, StorePartitionKey contained a syscache lookup that it never did
anything with, including never releasing the result.  Presumably the
reason why we don't see refcount-leak complaints is that the lookup
always fails; but in any case it's pretty useless, so remove it.

All of these errors were evidently introduced by the relation
partitioning feature.  Back-patch to v10 where that came in.

Amit Langote and Tom Lane

Discussion: https://postgr.es/m/20171127090105.1463.3962@wrigleys.postgresql.org
Discussion: https://postgr.es/m/20171127091341.1468.72696@wrigleys.postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/heap.c       | 5 ++---
src/backend/commands/tablecmds.c | 3 +++
2 files changed, 5 insertions(+), 3 deletions(-)



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


end of thread, other threads:[~2017-11-28 00:22 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 00:22 pgsql: Fix assorted syscache lookup sloppiness in partition-related cod Tom Lane <tgl@sss.pgh.pa.us>
2017-11-28 00:22 pgsql: Fix assorted syscache lookup sloppiness in partition-related cod Tom Lane <tgl@sss.pgh.pa.us>

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