how to check if a database exists programatically

From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: <pgsql-general(at)postgresql(dot)org>
Subject: how to check if a database exists programatically
Date: 2005-12-08 11:55:10
Message-ID: 967CFC4343BF2A4DAFACD026D33DC85118EC9F@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i have to write a shell script in which i have to check if the database "abc" exists or not

how should i do it ? some select query

select * from ??? where database_name = 'abc';

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2005-12-08 12:11:41 Re: how to check if a database exists programatically
Previous Message Martijn van Oosterhout 2005-12-08 11:43:11 Re: memory leak under heavy load?