Is it possible to load data into Postgres using COPY, where the data includes a SELECT statement?
You do it like bellow:

psql -c '\copy (SELECT * FROM mytable where col1=something) to mytable.dat'


Then load dat file using COPY

psql -c '\copy mytable from mytable.dat'