Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Last active March 3, 2019 01:38
Show Gist options
  • Save elhoyos/8fa066c8ded4e6502a832517c50e3e96 to your computer and use it in GitHub Desktop.
Save elhoyos/8fa066c8ded4e6502a832517c50e3e96 to your computer and use it in GitHub Desktop.
Load data, quickly
UPDATE pg_index SET indisready = false WHERE indrelid = 'my_table'::regclass::oid;
\copy my_table(column1, column2, ...) FROM 'my_table.csv' CSV HEADER;
UPDATE pg_index SET indisready = true WHERE indrelid = 'my_table'::regclass::oid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment