Re: [GENERAL] Passing parameters into an in-line psql invocation

2011-06-02 Thread Leif Biberg Kristensen
On Thursday 2. June 2011 18.58.23 Gauthier, Dave wrote: > 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 abilit

Re: [GENERAL] Passing parameters into an in-line psql invocation

2011-06-02 Thread Bosco Rama
Gauthier, Dave wrote: > > 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. You may want to use the --set or --variable options of psql and then referen

Re: [GENERAL] Passing parameters into an in-line psql invocation

2011-06-02 Thread John R Pierce
On 06/02/11 9:58 AM, Gauthier, Dave wrote: 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. on the psql command line, -v name=value or --set

[GENERAL] Passing parameters into an in-line psql invocation

2011-06-02 Thread Gauthier, Dave
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 ("thesql