1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 00:58:02 +00:00

Merge pull request #9 from bhargavrpatel/bhargavrpatel-patch-1

Add \copy command
This commit is contained in:
Josh Branchaud
2016-02-14 14:21:56 -06:00

View File

@@ -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)