Search Postgresql Archives

Re: Accessing environment variables from psql (SOLVED)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux