vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin |
| ||||
| Mario Splivalo написа: > 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? A workaround: add "--list" option to the command line and grep for the database you need. -- Milen A. Radev -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin |