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

Add \copy command

This commit is contained in:
Bhargav Patel
2016-02-09 20:49:01 -05:00
parent 9a9773e049
commit f53eb765f0

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)