Re: Accessing environment variables from psql (SOLVED)

Поиск
Список
Период
Сортировка
От Andreas Seltenreich
Тема Re: Accessing environment variables from psql (SOLVED)
Дата
Msg-id 874qef1kcj.fsf@gate450.dyndns.org
обсуждение исходный текст
Ответ на Re: Accessing environment variables from psql (SOLVED)  ("Leif B. Kristensen" <leif@solumslekt.org>)
Ответы Re: Accessing environment variables from psql (SOLVED)  ("Leif B. Kristensen" <leif@solumslekt.org>)
Список pgsql-general
Leif B. Kristensen writes:

> So, the problem is solved, sort of. It may also be prudent to save the
> old pwd and return there when the work is done:
>
> leif=> \set olddir `echo $PWD`
> leif=> \set importdir `echo $IMPORTDIR`
> leif=> \cd :importdir
> leif=> \i test.sql
> leif=> \cd :olddir

You can concatenate values using \set. So using

    \set importfile :importdir /test.sql
    \i :importfile

you won't have to mess with $PWD.

regards,
Andreas

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

Предыдущее
От: Benjamin Smith
Дата:
Сообщение: Lost in Foreign Key land
Следующее
От: Brian K Boonstra
Дата:
Сообщение: Note: Compiling on Windows with free Microsoft compilers