Re: Perl and psql variables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Perl and psql variables
Дата
Msg-id 19055.1146069492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Perl and psql variables  (Mark Campbell <mdc@ucs.co.za>)
Ответы Re: Perl and psql variables
Список pgsql-novice
Mark Campbell <mdc@ucs.co.za> writes:
> the perl script generates a variable called $month (which is the current
> month), I then need that month variable passed as a command line line
> parameter to psql. eg psql -f sql.file --variable "month = $month"
> then do a SELECT with the variable called :month

How about something like

    (
      echo "\set :month = $month"
      cat sql.file
    ) | psql

            regards, tom lane

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

Предыдущее
От: Oscar Rodriguez Fonseca
Дата:
Сообщение: Re: How to obtain algebraic sum of equal lines
Следующее
От: Mark Campbell
Дата:
Сообщение: Re: Perl and psql variables