Avoid SIGSEGV in pg_get_database_ddl() on NULL tablespace

There is a narrow race in which a concurrent ALTER DATABASE ... SET
TABLESPACE moves the database off the tablespace and a DROP TABLESPACE
removes it between the syscache lookup and the catalog scan. If that
happens, output an error.

Author: Chao Li <[email protected]>
Reviewed-by: Jack Bonatakis <[email protected]>
Reviewed-by: Satyanarayana Narlapuram <[email protected]>
Reviewed-by: Japin Li <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5642a0367c2fe69684800c5d5c5929c20d99ef72

Modified Files
--------------
src/backend/utils/adt/ddlutils.c | 7 +++++++
1 file changed, 7 insertions(+)

Reply via email to