Created
June 4, 2014 17:44
-
-
Save xCASx/7a1daf996401eb1b054d to your computer and use it in GitHub Desktop.
Useful Postgres queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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