3 ms·
If I have to run complex queries over a CSV I usually use COPY to import it into Postgres.
by oftenwrong 7y ago
If I have to run complex queries over a CSV I usually use COPY to import it into Postgres.
- jolmg 7y agoThis does the same thing, only with SQLite. The main point of this tool is to concisely join the steps of 1) starting your SQL client, 2) loading the CSV, 3) running the query, in a single step. 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.