SELECT datname FROM pg_database WHERE datistemplate = false AND datallowconn = true And datname NOT IN ('postgres')
Using the code above, I get all the databases except postgres
as shown in the image below:
Is there any better/cleaner/nicer way than my code above to get the same result?
Best Answer
There is no real improvement possible, but I think the following is more readable: