Re: How to query information schema from shell script - Mailing list pgsql-sql

From Jon Horsman
Subject Re: How to query information schema from shell script
Date
Msg-id 4f4c2a010610280818u76670cf0x2da8ec3efebcd3fc@mail.gmail.com
Whole thread Raw
In response to Re: How to query information schema from shell script  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Case Preservation disregarding case sensitivity?
Next
From: chester c young
Date:
Subject: Re: Add calculated fields from one table to other table