Avoid crash in rare case of concurrent DROP
authorAlvaro Herrera <[email protected]>
Fri, 5 Nov 2021 15:29:35 +0000 (12:29 -0300)
committerAlvaro Herrera <[email protected]>
Fri, 5 Nov 2021 15:29:35 +0000 (12:29 -0300)
commite0eaeafd66462b1a584831f35f10ec1e017c3845
tree6a9560e22dfd33decde26b2586fdb60916419d5f
parent71aeaf245b237bc7c3cfceb4bbbe7a8489da82fb
Avoid crash in rare case of concurrent DROP

When a role being dropped contains is referenced by catalog objects that
are concurrently also being dropped, a crash can result while trying to
construct the string that describes the objects.  Suppress that by
ignoring objects whose descriptions are returned as NULL.

The majority of relevant codesites were already cautious about this
already; we had just missed a couple.

This is an old bug, so backpatch all the way back.

Reported-by: Alexander Lakhin <[email protected]>
Discussion: https://postgr.es/m/17126-21887f04508cb5c8@postgresql.org
src/backend/catalog/dependency.c
src/backend/catalog/pg_shdepend.c