On 10/21/2013 11:41 PM, Luca Ferrari wrote:
On Tue, Oct 22, 2013 at 7:20 AM, James Sewell <james.sewell@xxxxxxxxxxxx> 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 from a :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@xxxxxxxxx
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general