Skip to content

Instantly share code, notes, and snippets.

@xCASx
Created June 4, 2014 17:44
Show Gist options
  • Save xCASx/7a1daf996401eb1b054d to your computer and use it in GitHub Desktop.
Save xCASx/7a1daf996401eb1b054d to your computer and use it in GitHub Desktop.
Useful Postgres queries
-- export to csv
Copy (Select * From tablename) To 'C:\\dev\01.csv' With CSV;
-- import from csv
COPY tablename FROM 'C:\data\01.csv' DELIMITER ',' CSV HEADER;
-- Create a Range From 1 to 10
SELECT * FROM GENERATE_SERIES(1, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment