I am using Ruby to call postgresql through the shell via a command like:
%x[ psql -A -F "," -o feeds/tmp.csv -f lib/sql/query.sql -v id_list="#{id_list}" ]
query.sql looks like but can be changed:
Select *
From tbl_test
Where id in (:id_list)
The query should resolve to:
Select *
From tbl_test
Where id in ('a','b','c')
Thanks in advance.