shell scripting

From: Marc Tardif <intmktg(at)CAM(dot)ORG>
To: pgsql-general(at)postgresql(dot)org
Subject: shell scripting
Date: 2000-04-04 22:05:22
Message-ID: Pine.LNX.4.10.10004041800410.5070-100000@Gloria.CAM.ORG
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is ther any way to foresee if a database exists or if a user has
permission to read/write a database from within a shell script?
The best I've come up with so far is to check for the exit status after
running a random command. For example:

/usr/local/pgsql/bin/pg_dump -s db > schema
if [ $? != 0 ]; then
echo "something went wrong somewhere";
fi

Unfortunately, this is not very accurate as it still doesn't say if I have
read and/or write permissions to the database.

Please let me know if you have anything,
Marc

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Henderson 2000-04-04 23:12:43 Re: Fetching record of the day
Previous Message Herbert Liechti 2000-04-04 20:34:49 Re: Re: Apache::Session