On 10/21/2013 11:41 PM, Luca Ferrari wrote:
> On Tue, Oct 22, 2013 at 7:20 AM, James Sewell <james.sewell@lisasoft.com> wrote:
>
>> I need a way to backup either from SQL in PSQL (possibly \!) or from a PG/PLSQL function to a file with a name set
froma :variable.
>
> Could it be something like this:
>
> # \setenv myFile 'filename'
> # \! pg_dump > $myFile
>
> Unfortunately there seems to be no unsetenv command to remove the
> variable within the script.
Call it again without the variable value:
http://www.postgresql.org/docs/9.3/interactive/app-psql.html
\setenv [ name [ value ] ]
Sets the environment variable name to value, or if the value is not
supplied, unsets the environment variable
\setenv myFile
>
>
> Luca
>
>
--
Adrian Klaver
adrian.klaver@gmail.com