Search Postgresql Archives

Passing parameters into an in-line psql invocation

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

 



Hi:

 

I'd like to pass a parameter into an inline psql call that itself calls an sql script, something like...

 

psql mydb -c "\i thesqlscript foo"

 

Where"foo" is the value I want to pass in.

 

Just as good would be the ability to sniff out an environment variable from within the sql script ("thesqlscript" in the example above).  In perl, I would use $ENV{VARNAME}.  Is there something like that in Postgres SQL?

 

V8.3.4 on Linux (upgrading to v9 very soon).

 

Thanks for any ideas !


[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