Re: How to query information schema from shell script

Поиск
Список
Период
Сортировка
От Jon Horsman
Тема Re: How to query information schema from shell script
Дата
Msg-id 4f4c2a010610280818u76670cf0x2da8ec3efebcd3fc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to query information schema from shell script  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список 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 по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Case Preservation disregarding case sensitivity?
Следующее
От: chester c young
Дата:
Сообщение: Re: Add calculated fields from one table to other table