I ended up going the pg_catalog route, something like (off the top of my head without a linux machine by to test it)
output=$(psql -d template1 -t -c "select * from pg_database where datname='testdb'") if [ -z "$output" ]; then psql createdb testdb else echo 'the db already exists' fi I did the exact same thing for the user using pg_user and usename Jon ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly