Is there a “simple way” to check that the database is new and doesn’t have any modifications? When I’m referring to a new database I mean a recently created database (e.g. create database newdb)
Perhaps using psql to execute some SQL statement to check information in pg_catalog
Thanks in advance.
Without more investigation, I suggest the following query
This is the query that psql uses to display the contents of the
\dcommand. If the result of this query is nothing, than the database has no tables, views,… I assume that en empty database is a sign of a newly created database. Note that the result from the query above excludespg_catalog, so changes in settings or similar will not be returned.