Search Postgresql Archives

Re: How to define variables in psql scripts?

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

 



Kynn Jones wrote:
<< kj314159265358979 >>

I know that one can store multiple psql commands and SQL statements in
a separate "script" file, and then "source" the script file, e.g. with
the \i command.

My question is, can I define variables in such a script file?  E.g. can
I do something like the following unix-shell-like script?

You can use psql variables
http://www.postgresql.org/docs/8.1/static/app-psql.html#APP-PSQL-VARIABLES

Be careful with quoting issues though.
--
  Richard Huxton
  Archonet Ltd


[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