From f53eb765f0ca29c8bd8aa004a73cd7bef504a018 Mon Sep 17 00:00:00 2001 From: Bhargav Patel Date: Tue, 9 Feb 2016 20:49:01 -0500 Subject: [PATCH] Add \copy command --- postgres/export-query-results-to-a-csv.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/postgres/export-query-results-to-a-csv.md b/postgres/export-query-results-to-a-csv.md index 1d9fb6d..271d422 100644 --- a/postgres/export-query-results-to-a-csv.md +++ b/postgres/export-query-results-to-a-csv.md @@ -28,4 +28,10 @@ keyword: copy (select * from pokemons) to '/tmp/pokemon_dump.csv' csv header; ``` +If your user has limited access, you can use the \copy command like so: + +```sql +\copy (select * from pokemons) to '/tmp/pokemon_dump.csv' with csv header; +``` + [source](http://stackoverflow.com/questions/1120109/export-postgres-table-to-csv-file-with-headings)