Re: how to check if a database exists programatically

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to check if a database exists programatically
Date: 2005-12-08 12:11:41
Message-ID: 20051208121141.GE11861@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am 08.12.2005, um 17:25:10 +0530 mailte surabhi.ahuja folgendes:
> 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';

You can parse the output from 'psql -l'.

HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2005-12-08 12:20:09 Re: how to check if a database exists programatically
Previous Message surabhi.ahuja 2005-12-08 11:55:10 how to check if a database exists programatically