psql shell return codes - checking if database exists - Mailing list pgsql-admin

From Mario Splivalo
Subject psql shell return codes - checking if database exists
Date
Msg-id 48048E3E.2090807@megafon.hr
Whole thread Raw
Responses Re: psql shell return codes - checking if database exists  ("Milen A. Radev" <milen@radev.net>)
List pgsql-admin
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

pgsql-admin by date:

Previous
From: lfedden@contextworld.com
Date:
Subject: OID and filesystem issues
Next
From: "Dmitry Shubin"
Date:
Subject: postgres 8.1 usermanagement problem