pgsql: Check syscache result in AlterStatistics - Mailing list pgsql-committers

From Tomas Vondra
Subject pgsql: Check syscache result in AlterStatistics
Date
Msg-id E1nBSRk-0007yL-RF@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Check syscache result in AlterStatistics

The syscache lookup may return NULL even for valid OID, for example due
to a concurrent DROP STATISTICS, so a HeapTupleIsValid is necessary.
Without it, it may fail with a segfault.

Reported by Alexander Lakhin, patch by me. Backpatch to 13, where ALTER
STATISTICS ... SET STATISTICS was introduced.

Backpatch-through: 13
Discussion: https://postgr.es/m/17372-bf3b6e947e35ae77%40postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6d554e3fcd6fb8be2dbcbd3521e2947ed7a552cb

Modified Files
--------------
src/backend/commands/statscmds.c | 2 ++
1 file changed, 2 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Remove useless inline marker.
Next
From: Tomas Vondra
Date:
Subject: pgsql: Check syscache result in AlterStatistics