Tim Kane <tim.kane@xxxxxxxxx> writes: > It seems the behaviour of the --command / -c option is such that it will > ignore any variables set on the command-line. If memory serves, the string given to -c is just fired off to the server as-is. It's not broken into separate commands, and I think we don't do substitutions on it either, which would explain this result. There have been some discussions of trying to make it work more like processing of normal input would do, but people are too afraid of breaking existing applications by changing the semantics. I'd suggest something like echo 'select :TESTVAR;' | psql --variable TESTVAR='123' regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general