Re: [GENERAL] Accessing environment variables from psql (SOLVED)

2005-04-10 Thread Leif B. Kristensen
On Sunday 10 April 2005 03:39, Andreas Seltenreich wrote: > You can concatenate values using \set. So using > > \set importfile :importdir /test.sql > \i :importfile > > you won't have to mess with $PWD. Thanks for the tip, Andreas. But I have about a dozen sql files in the import direct

Re: [GENERAL] Accessing environment variables from psql (SOLVED)

2005-04-09 Thread Andreas Seltenreich
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

Re: [GENERAL] Accessing environment variables from psql (SOLVED)

2005-04-09 Thread Leif B. Kristensen
On Saturday 09 April 2005 13:59, Leif B. Kristensen wrote: > Is there a way to access environment variables from psql? After scrutinizing the psql documentation at , I found that this actually works: leif=> \set importdir `echo $IMPORTDIR