Re: psql variables

Поиск
Список
Период
Сортировка
От ptjm@interlog.com (Patrick TJ McPhee)
Тема Re: psql variables
Дата
Msg-id 3aj3prF6ba6tgU1@uni-berlin.de
обсуждение исходный текст
Ответ на psql variables  (Paul Cunningham <paul@blueseacommunications.com>)
Ответы Re: psql variables  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-general
In article <4235B688.8000407@blueseacommunications.com>,
Paul Cunningham <paul@blueseacommunications.com> wrote:
% I use a bash script (similar to following example) to update tables.
%
% psql -v passed_in_var=\'some_value\'  -f script_name ....
%
% Is it possible to pass a value back from psql to the bash script?

If you run it like this

 $(psql -v passed_in_var=\'some_value\'  -f script_name)

and arrange for all the script output to be in the form

  var1="value 1" var2="value 2"
  var3="value 3" ...

then var1, var2, etc will be set in bash (or ksh, or the posix shell).
Note that there are no spaces around the equals signs.
--

Patrick TJ McPhee
North York  Canada
ptjm@interlog.com

В списке pgsql-general по дате отправления:

Предыдущее
От: "Andrus Moor"
Дата:
Сообщение: Re: Referential integrity using constant in foreign key
Следующее
От: "sales@qlrmanager.com"
Дата:
Сообщение: Looking for persons interested in a Beta version of a PostgreSQL reporting tool