On Wed, Jan 17, 2018 at 05:47:16PM +0200, Graham Leggett wrote:
> I need to test whether a database is empty, in other words “createdb”
> has been executed but no data of any kind appears in that database.
> What is the correct postgresql way to do this?
There is none, because it highly depends on how you'll define empty.
Please note that even directly after "create database x;" your db might
not be empty, if you had some things created earlier in template1.
Best regards,
depesz