Re: [GENERAL] Setting a psql variable from SQL output

2011-08-26 Thread Bobby Dewitt
I'm using a home-grown Ruby script to execute a given SQL script against all of the databases in our environment. I could modify the Ruby script to execute a different SQL script depending on the database version, but that would require a lot of changes to the Ruby code and would probably only be

Re: [GENERAL] Setting a psql variable from SQL output

2011-08-26 Thread Rob Sargent
On 08/26/2011 02:16 PM, Merlin Moncure wrote: > On Fri, Aug 26, 2011 at 3:01 PM, Bobby Dewitt wrote: >> Is there a way to get output from a SQL command or function and have it be >> set to a variable value in psql? My main goal is to execute a certain >> script depending on the version of the d

Re: [GENERAL] Setting a psql variable from SQL output

2011-08-26 Thread Merlin Moncure
On Fri, Aug 26, 2011 at 3:01 PM, Bobby Dewitt wrote: > Is there a way to get output from a SQL command or function and have it be > set to a variable value in psql?  My main goal is to execute a certain > script depending on the version of the database server (either 8.4 or 9.0). >  I can dynamica

[GENERAL] Setting a psql variable from SQL output

2011-08-26 Thread Bobby Dewitt
Is there a way to get output from a SQL command or function and have it be set to a variable value in psql? My main goal is to execute a certain script depending on the version of the database server (either 8.4 or 9.0). I can dynamically execute a script using the following, but I can't get i