From: Mario Splivalo <mario.splivalo@megafon.hr>
To: pgsql-admin@postgresql.org
Subject: psql shell return codes - checking if database exists
Date: Tue, 15 Apr 2008 13:15:10 +0200
Message-ID: <48048E3E.2090807@megafon.hr> (raw)
I need to check, from a bash script, if certain database exists in a
postgres cluster. When I issue:
psql -U someuser somedatabase
psql returns error code 2 regardless of 'no user' or 'no database'
condition. How could I distinguish from the two?
Mario
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mario.splivalo@megafon.hr
Subject: Re: psql shell return codes - checking if database exists
In-Reply-To: <48048E3E.2090807@megafon.hr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox