Add null check on get_tablespace_name() return in pg_get_database_ddl_internal

From: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Add null check on get_tablespace_name() return in pg_get_database_ddl_internal
Date: 2026-04-22 22:20:36
Message-ID: CAHg+QDd4mVPTT1P1E8o1k+2UzHkp55595v2GWpm9dENRwJCuYQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

A concurrent tablespace drop could lead to null deref in
pg_get_database_ddl. I acknowledge this is a corner case. Adding a patch to
fix this to keep the code clean.

Thanks,
Satya

Attachment Content-Type Size
0001-Fix-NULL-deref-in-pg_get_database_ddl-on-concurrent-tablespace-drop.patch application/octet-stream 558 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-04-22 23:33:28 Re: [PATCH] Fix hashed ScalarArrayOp semantics for NULL LHS with non-strict comparators
Previous Message Tom Lane 2026-04-22 22:13:28 Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times