in most cases, I prefer a shell script with an here-document. (shell-variables expand nicely in here-documents):
#!/bin/sh
PSQL=/local/postgres/bin/psql
SOME_VALUE=123
$PSQL my_database <<THE_END
DELETE FROM my_table
WHERE my_column <= $SOME_VALUE
;
THE_END
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…