by oftenwrong · 7y ago · 0 comments
You can also join those steps in a single command with Postgres, something like:
psql << EOF
create table ...
copy tablename from filename csv ...
copy (select ...) to stdout csv ...
drop table ...
EOF
However, this tool is more concise to do the above and facilitates combining with brace-expansion, file tab-completion, and <() process substitution.