On Sat, 11 Apr 2026 at 01:58, Ayush Tiwari <ayushtiwari.slg01@gmail.com> wrote:
> Deterministic reproduction:
>
> CREATE DATABASE regression_testdb;
> SET allow_system_table_mods = on;
> UPDATE pg_database
> SET dattablespace = 99999
> WHERE datname = 'regression_testdb';
> RESET allow_system_table_mods;
>
> SELECT * FROM pg_get_database_ddl('regression_testdb');
>
> The attached patch fixes this by checking for NULL before calling
> pg_strcasecmp(). In that case, pg_get_database_ddl() simply omits the
> TABLESPACE clause.
Can you explain why this method of self-inflicted catalogue corruption
is any more important than any of the just-about-infinite other ways
there are of causing issues by manually updating the catalogue tables?
The typical response to this sort of thing can be seen in the thread
in [1], in particular, the response in [2].
David
[1] https://www.postgresql.org/message-id/19383-e6b60ec2a4fce5b0@postgresql.org
[2] https://www.postgresql.org/message-id/1538113.1768921841%40sss.pgh.pa.us