On Jan 14, 2006, at 23:54 , Jeff Boes wrote:

Tony Wasson wrote:

Stuff like this works for me in a SQL file.... \set edate 'CURRENT_DATE::DATE' SELECT * FROM some_table WHERE update_date = :edate;

Sure, but that was not my question. I want to be able to set the variable on the command line, BUT have it default to a value inside the SQL script if not present on the command line.

You could write a wrapper script that would accept a command line argument and load the file with the appropriate SET statement prepended.

Michael Glaesemann
grzm myrealbox com




---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

Reply via email to