Adrian Klaver <adrian.kla...@aklaver.com> writes: > On 4/15/25 07:48, Igor Korot wrote: >> Is there a field in the pg_databases table which indicates that >> particular DB is a system one?
> No there is not. As a practical matter they are no different then any > user created database, other then template0 is created with datallowconn > set to false. Yeah; in a very real sense there isn't such a thing as a "system database" in Postgres. There are pre-created databases that have specific uses (such as being the default template for CREATE DATABASE), but those uses are identified by name not by OID. You can drop template1, and the only thing that will be unhappy is CREATE DATABASE, and if you make a new DB that is named template1 then CREATE DATABASE will be happy again. regards, tom lane