Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Admin > psql shell retu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4913 of 5152
Post > Topic >>

psql shell return codes - checking if database exists

by mario.splivalo@[EMAIL PROTECTED] (Mario Splivalo) Apr 15, 2008 at 01:15 PM

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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
 




 2 Posts in Topic:
psql shell return codes - checking if database exists
mario.splivalo@[EMAIL PRO  2008-04-15 13:15:10 
Re: psql shell return codes - checking if database exists
milen@[EMAIL PROTECTED]   2008-04-15 15:10:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 20 4:01:14 CDT 2008.