determining existence of database and language

Started by Chris Sanoover 17 years ago2 messagesgeneral
Jump to latest
#1Chris Sano
csano32@gmail.com

I'm trying to build a SQL script that will create a database if it
doesn't already exist. I've looked everywhere and haven't been able to
find anything. Am I missing something? Thanks.

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Chris Sano (#1)
Re: determining existence of database and language

Chris Sano wrote:

I'm trying to build a SQL script that will create a database if it
doesn't already exist. I've looked everywhere and haven't been able to
find anything. Am I missing something? Thanks.

SELECT * FROM pg_database will tell you what databases exist.