Reference: Copy Statement
Copy statements allow bulk im- and export of tables:
Usage example:
-- Export
copy (select * from movies) to 'movies_backup.csv';
-- Import
copy movies2 from 'movies_backup.csv';
Options
Copy supports a number of options controlling the format.
Format
:csv
,text
,binary
. Only for copy to:numpy
.Delimiter
:
The record separator fortext
andcsv
formats. By default\t
, and,
.Header
:
If thetext
andcsv
has a header. By defaultfalse
.Null
:
The string that represents anull
value intext
andcsv
formats. By default\N
, and empty string.Quote
:
The quoting character for thecsv
format. By default"
. This can be used to insert values containing the delimiter.Escape
:
The escape character for thecsv
format. By default"
. This can be used to escape the quote character.