1COPY(7)                  PostgreSQL 11.6 Documentation                 COPY(7)
2
3
4

NAME

6       COPY - copy data between a file and a table
7

SYNOPSIS

9       COPY table_name [ ( column_name [, ...] ) ]
10           FROM { 'filename' | PROGRAM 'command' | STDIN }
11           [ [ WITH ] ( option [, ...] ) ]
12
13       COPY { table_name [ ( column_name [, ...] ) ] | ( query ) }
14           TO { 'filename' | PROGRAM 'command' | STDOUT }
15           [ [ WITH ] ( option [, ...] ) ]
16
17       where option can be one of:
18
19           FORMAT format_name
20           OIDS [ boolean ]
21           FREEZE [ boolean ]
22           DELIMITER 'delimiter_character'
23           NULL 'null_string'
24           HEADER [ boolean ]
25           QUOTE 'quote_character'
26           ESCAPE 'escape_character'
27           FORCE_QUOTE { ( column_name [, ...] ) | * }
28           FORCE_NOT_NULL ( column_name [, ...] )
29           FORCE_NULL ( column_name [, ...] )
30           ENCODING 'encoding_name'
31

DESCRIPTION

33       COPY moves data between PostgreSQL tables and standard file-system
34       files.  COPY TO copies the contents of a table to a file, while COPY
35       FROM copies data from a file to a table (appending the data to whatever
36       is in the table already).  COPY TO can also copy the results of a
37       SELECT query.
38
39       If a list of columns is specified, COPY will only copy the data in the
40       specified columns to or from the file. If there are any columns in the
41       table that are not in the column list, COPY FROM will insert the
42       default values for those columns.
43
44       COPY with a file name instructs the PostgreSQL server to directly read
45       from or write to a file. The file must be accessible by the PostgreSQL
46       user (the user ID the server runs as) and the name must be specified
47       from the viewpoint of the server. When PROGRAM is specified, the server
48       executes the given command and reads from the standard output of the
49       program, or writes to the standard input of the program. The command
50       must be specified from the viewpoint of the server, and be executable
51       by the PostgreSQL user. When STDIN or STDOUT is specified, data is
52       transmitted via the connection between the client and the server.
53

PARAMETERS

55       table_name
56           The name (optionally schema-qualified) of an existing table.
57
58       column_name
59           An optional list of columns to be copied. If no column list is
60           specified, all columns of the table will be copied.
61
62       query
63           A SELECT(7), VALUES(7), INSERT(7), UPDATE(7) or DELETE(7) command
64           whose results are to be copied. Note that parentheses are required
65           around the query.
66
67           For INSERT, UPDATE and DELETE queries a RETURNING clause must be
68           provided, and the target relation must not have a conditional rule,
69           nor an ALSO rule, nor an INSTEAD rule that expands to multiple
70           statements.
71
72       filename
73           The path name of the input or output file. An input file name can
74           be an absolute or relative path, but an output file name must be an
75           absolute path. Windows users might need to use an E'' string and
76           double any backslashes used in the path name.
77
78       PROGRAM
79           A command to execute. In COPY FROM, the input is read from standard
80           output of the command, and in COPY TO, the output is written to the
81           standard input of the command.
82
83           Note that the command is invoked by the shell, so if you need to
84           pass any arguments to shell command that come from an untrusted
85           source, you must be careful to strip or escape any special
86           characters that might have a special meaning for the shell. For
87           security reasons, it is best to use a fixed command string, or at
88           least avoid passing any user input in it.
89
90       STDIN
91           Specifies that input comes from the client application.
92
93       STDOUT
94           Specifies that output goes to the client application.
95
96       boolean
97           Specifies whether the selected option should be turned on or off.
98           You can write TRUE, ON, or 1 to enable the option, and FALSE, OFF,
99           or 0 to disable it. The boolean value can also be omitted, in which
100           case TRUE is assumed.
101
102       FORMAT
103           Selects the data format to be read or written: text, csv (Comma
104           Separated Values), or binary. The default is text.
105
106       OIDS
107           Specifies copying the OID for each row. (An error is raised if OIDS
108           is specified for a table that does not have OIDs, or in the case of
109           copying a query.)
110
111       FREEZE
112           Requests copying the data with rows already frozen, just as they
113           would be after running the VACUUM FREEZE command. This is intended
114           as a performance option for initial data loading. Rows will be
115           frozen only if the table being loaded has been created or truncated
116           in the current subtransaction, there are no cursors open and there
117           are no older snapshots held by this transaction. It is currently
118           not possible to perform a COPY FREEZE on a partitioned table.
119
120           Note that all other sessions will immediately be able to see the
121           data once it has been successfully loaded. This violates the normal
122           rules of MVCC visibility and users specifying should be aware of
123           the potential problems this might cause.
124
125       DELIMITER
126           Specifies the character that separates columns within each row
127           (line) of the file. The default is a tab character in text format,
128           a comma in CSV format. This must be a single one-byte character.
129           This option is not allowed when using binary format.
130
131       NULL
132           Specifies the string that represents a null value. The default is
133           \N (backslash-N) in text format, and an unquoted empty string in
134           CSV format. You might prefer an empty string even in text format
135           for cases where you don't want to distinguish nulls from empty
136           strings. This option is not allowed when using binary format.
137
138               Note
139               When using COPY FROM, any data item that matches this string
140               will be stored as a null value, so you should make sure that
141               you use the same string as you used with COPY TO.
142
143       HEADER
144           Specifies that the file contains a header line with the names of
145           each column in the file. On output, the first line contains the
146           column names from the table, and on input, the first line is
147           ignored. This option is allowed only when using CSV format.
148
149       QUOTE
150           Specifies the quoting character to be used when a data value is
151           quoted. The default is double-quote. This must be a single one-byte
152           character. This option is allowed only when using CSV format.
153
154       ESCAPE
155           Specifies the character that should appear before a data character
156           that matches the QUOTE value. The default is the same as the QUOTE
157           value (so that the quoting character is doubled if it appears in
158           the data). This must be a single one-byte character. This option is
159           allowed only when using CSV format.
160
161       FORCE_QUOTE
162           Forces quoting to be used for all non-NULL values in each specified
163           column.  NULL output is never quoted. If * is specified, non-NULL
164           values will be quoted in all columns. This option is allowed only
165           in COPY TO, and only when using CSV format.
166
167       FORCE_NOT_NULL
168           Do not match the specified columns' values against the null string.
169           In the default case where the null string is empty, this means that
170           empty values will be read as zero-length strings rather than nulls,
171           even when they are not quoted. This option is allowed only in COPY
172           FROM, and only when using CSV format.
173
174       FORCE_NULL
175           Match the specified columns' values against the null string, even
176           if it has been quoted, and if a match is found set the value to
177           NULL. In the default case where the null string is empty, this
178           converts a quoted empty string into NULL. This option is allowed
179           only in COPY FROM, and only when using CSV format.
180
181       ENCODING
182           Specifies that the file is encoded in the encoding_name. If this
183           option is omitted, the current client encoding is used. See the
184           Notes below for more details.
185

OUTPUTS

187       On successful completion, a COPY command returns a command tag of the
188       form
189
190           COPY count
191
192       The count is the number of rows copied.
193
194           Note
195           psql will print this command tag only if the command was not COPY
196           ... TO STDOUT, or the equivalent psql meta-command \copy ... to
197           stdout. This is to prevent confusing the command tag with the data
198           that was just printed.
199

NOTES

201       COPY TO can only be used with plain tables, not with views. However,
202       you can write COPY (SELECT * FROM viewname) TO ...  to copy the current
203       contents of a view.
204
205       COPY FROM can be used with plain, foreign, or partitioned tables or
206       with views that have INSTEAD OF INSERT triggers.
207
208       COPY only deals with the specific table named; it does not copy data to
209       or from child tables. Thus for example COPY table TO shows the same
210       data as SELECT * FROM ONLY table. But COPY (SELECT * FROM table) TO ...
211       can be used to dump all of the data in an inheritance hierarchy.
212
213       You must have select privilege on the table whose values are read by
214       COPY TO, and insert privilege on the table into which values are
215       inserted by COPY FROM. It is sufficient to have column privileges on
216       the column(s) listed in the command.
217
218       If row-level security is enabled for the table, the relevant SELECT
219       policies will apply to COPY table TO statements. Currently, COPY FROM
220       is not supported for tables with row-level security. Use equivalent
221       INSERT statements instead.
222
223       Files named in a COPY command are read or written directly by the
224       server, not by the client application. Therefore, they must reside on
225       or be accessible to the database server machine, not the client. They
226       must be accessible to and readable or writable by the PostgreSQL user
227       (the user ID the server runs as), not the client. Similarly, the
228       command specified with PROGRAM is executed directly by the server, not
229       by the client application, must be executable by the PostgreSQL user.
230       COPY naming a file or command is only allowed to database superusers or
231       users who are granted one of the default roles pg_read_server_files,
232       pg_write_server_files, or pg_execute_server_program, since it allows
233       reading or writing any file or running a program that the server has
234       privileges to access.
235
236       Do not confuse COPY with the psql instruction \copy.  \copy invokes
237       COPY FROM STDIN or COPY TO STDOUT, and then fetches/stores the data in
238       a file accessible to the psql client. Thus, file accessibility and
239       access rights depend on the client rather than the server when \copy is
240       used.
241
242       It is recommended that the file name used in COPY always be specified
243       as an absolute path. This is enforced by the server in the case of COPY
244       TO, but for COPY FROM you do have the option of reading from a file
245       specified by a relative path. The path will be interpreted relative to
246       the working directory of the server process (normally the cluster's
247       data directory), not the client's working directory.
248
249       Executing a command with PROGRAM might be restricted by the operating
250       system's access control mechanisms, such as SELinux.
251
252       COPY FROM will invoke any triggers and check constraints on the
253       destination table. However, it will not invoke rules.
254
255       For identity columns, the COPY FROM command will always write the
256       column values provided in the input data, like the INSERT option
257       OVERRIDING SYSTEM VALUE.
258
259       COPY input and output is affected by DateStyle. To ensure portability
260       to other PostgreSQL installations that might use non-default DateStyle
261       settings, DateStyle should be set to ISO before using COPY TO. It is
262       also a good idea to avoid dumping data with IntervalStyle set to
263       sql_standard, because negative interval values might be misinterpreted
264       by a server that has a different setting for IntervalStyle.
265
266       Input data is interpreted according to ENCODING option or the current
267       client encoding, and output data is encoded in ENCODING or the current
268       client encoding, even if the data does not pass through the client but
269       is read from or written to a file directly by the server.
270
271       COPY stops operation at the first error. This should not lead to
272       problems in the event of a COPY TO, but the target table will already
273       have received earlier rows in a COPY FROM. These rows will not be
274       visible or accessible, but they still occupy disk space. This might
275       amount to a considerable amount of wasted disk space if the failure
276       happened well into a large copy operation. You might wish to invoke
277       VACUUM to recover the wasted space.
278
279       FORCE_NULL and FORCE_NOT_NULL can be used simultaneously on the same
280       column. This results in converting quoted null strings to null values
281       and unquoted null strings to empty strings.
282

FILE FORMATS

284   Text Format
285       When the text format is used, the data read or written is a text file
286       with one line per table row. Columns in a row are separated by the
287       delimiter character. The column values themselves are strings generated
288       by the output function, or acceptable to the input function, of each
289       attribute's data type. The specified null string is used in place of
290       columns that are null.  COPY FROM will raise an error if any line of
291       the input file contains more or fewer columns than are expected. If
292       OIDS is specified, the OID is read or written as the first column,
293       preceding the user data columns.
294
295       End of data can be represented by a single line containing just
296       backslash-period (\.). An end-of-data marker is not necessary when
297       reading from a file, since the end of file serves perfectly well; it is
298       needed only when copying data to or from client applications using
299       pre-3.0 client protocol.
300
301       Backslash characters (\) can be used in the COPY data to quote data
302       characters that might otherwise be taken as row or column delimiters.
303       In particular, the following characters must be preceded by a backslash
304       if they appear as part of a column value: backslash itself, newline,
305       carriage return, and the current delimiter character.
306
307       The specified null string is sent by COPY TO without adding any
308       backslashes; conversely, COPY FROM matches the input against the null
309       string before removing backslashes. Therefore, a null string such as \N
310       cannot be confused with the actual data value \N (which would be
311       represented as \\N).
312
313       The following special backslash sequences are recognized by COPY FROM:
314
315       ┌─────────┬────────────────────────────┐
316Sequence Represents                 
317       ├─────────┼────────────────────────────┤
318       │\b       │ Backspace (ASCII 8)        │
319       ├─────────┼────────────────────────────┤
320       │\f       │ Form feed (ASCII 12)       │
321       ├─────────┼────────────────────────────┤
322       │\n       │ Newline (ASCII 10)         │
323       ├─────────┼────────────────────────────┤
324       │\r       │ Carriage return (ASCII 13) │
325       ├─────────┼────────────────────────────┤
326       │\t       │ Tab (ASCII 9)              │
327       ├─────────┼────────────────────────────┤
328       │\v       │ Vertical tab (ASCII 11)    │
329       ├─────────┼────────────────────────────┤
330       │\digits  │ Backslash followed by one  │
331       │         │ to three octal digits      │
332       │         │ specifies                  │
333       │         │        the character with  │
334       │         │ that numeric code          │
335       ├─────────┼────────────────────────────┤
336       │\xdigits │ Backslash x followed by    │
337       │         │ one or two hex digits      │
338       │         │ specifies                  │
339       │         │        the character with  │
340       │         │ that numeric code          │
341       └─────────┴────────────────────────────┘
342       Presently, COPY TO will never emit an octal or hex-digits backslash
343       sequence, but it does use the other sequences listed above for those
344       control characters.
345
346       Any other backslashed character that is not mentioned in the above
347       table will be taken to represent itself. However, beware of adding
348       backslashes unnecessarily, since that might accidentally produce a
349       string matching the end-of-data marker (\.) or the null string (\N by
350       default). These strings will be recognized before any other backslash
351       processing is done.
352
353       It is strongly recommended that applications generating COPY data
354       convert data newlines and carriage returns to the \n and \r sequences
355       respectively. At present it is possible to represent a data carriage
356       return by a backslash and carriage return, and to represent a data
357       newline by a backslash and newline. However, these representations
358       might not be accepted in future releases. They are also highly
359       vulnerable to corruption if the COPY file is transferred across
360       different machines (for example, from Unix to Windows or vice versa).
361
362       COPY TO will terminate each row with a Unix-style newline (“\n”).
363       Servers running on Microsoft Windows instead output carriage
364       return/newline (“\r\n”), but only for COPY to a server file; for
365       consistency across platforms, COPY TO STDOUT always sends “\n”
366       regardless of server platform.  COPY FROM can handle lines ending with
367       newlines, carriage returns, or carriage return/newlines. To reduce the
368       risk of error due to un-backslashed newlines or carriage returns that
369       were meant as data, COPY FROM will complain if the line endings in the
370       input are not all alike.
371
372   CSV Format
373       This format option is used for importing and exporting the Comma
374       Separated Value (CSV) file format used by many other programs, such as
375       spreadsheets. Instead of the escaping rules used by PostgreSQL's
376       standard text format, it produces and recognizes the common CSV
377       escaping mechanism.
378
379       The values in each record are separated by the DELIMITER character. If
380       the value contains the delimiter character, the QUOTE character, the
381       NULL string, a carriage return, or line feed character, then the whole
382       value is prefixed and suffixed by the QUOTE character, and any
383       occurrence within the value of a QUOTE character or the ESCAPE
384       character is preceded by the escape character. You can also use
385       FORCE_QUOTE to force quotes when outputting non-NULL values in specific
386       columns.
387
388       The CSV format has no standard way to distinguish a NULL value from an
389       empty string.  PostgreSQL's COPY handles this by quoting. A NULL is
390       output as the NULL parameter string and is not quoted, while a non-NULL
391       value matching the NULL parameter string is quoted. For example, with
392       the default settings, a NULL is written as an unquoted empty string,
393       while an empty string data value is written with double quotes ("").
394       Reading values follows similar rules. You can use FORCE_NOT_NULL to
395       prevent NULL input comparisons for specific columns. You can also use
396       FORCE_NULL to convert quoted null string data values to NULL.
397
398       Because backslash is not a special character in the CSV format, \., the
399       end-of-data marker, could also appear as a data value. To avoid any
400       misinterpretation, a \.  data value appearing as a lone entry on a line
401       is automatically quoted on output, and on input, if quoted, is not
402       interpreted as the end-of-data marker. If you are loading a file
403       created by another application that has a single unquoted column and
404       might have a value of \., you might need to quote that value in the
405       input file.
406
407           Note
408           In CSV format, all characters are significant. A quoted value
409           surrounded by white space, or any characters other than DELIMITER,
410           will include those characters. This can cause errors if you import
411           data from a system that pads CSV lines with white space out to some
412           fixed width. If such a situation arises you might need to
413           preprocess the CSV file to remove the trailing white space, before
414           importing the data into PostgreSQL.
415
416           Note
417           CSV format will both recognize and produce CSV files with quoted
418           values containing embedded carriage returns and line feeds. Thus
419           the files are not strictly one line per table row like text-format
420           files.
421
422           Note
423           Many programs produce strange and occasionally perverse CSV files,
424           so the file format is more a convention than a standard. Thus you
425           might encounter some files that cannot be imported using this
426           mechanism, and COPY might produce files that other programs cannot
427           process.
428
429   Binary Format
430       The binary format option causes all data to be stored/read as binary
431       format rather than as text. It is somewhat faster than the text and CSV
432       formats, but a binary-format file is less portable across machine
433       architectures and PostgreSQL versions. Also, the binary format is very
434       data type specific; for example it will not work to output binary data
435       from a smallint column and read it into an integer column, even though
436       that would work fine in text format.
437
438       The binary file format consists of a file header, zero or more tuples
439       containing the row data, and a file trailer. Headers and data are in
440       network byte order.
441
442           Note
443           PostgreSQL releases before 7.4 used a different binary file format.
444
445       File Header
446           The file header consists of 15 bytes of fixed fields, followed by a
447           variable-length header extension area. The fixed fields are:
448
449           Signature
450               11-byte sequence PGCOPY\n\377\r\n\0 — note that the zero byte
451               is a required part of the signature. (The signature is designed
452               to allow easy identification of files that have been munged by
453               a non-8-bit-clean transfer. This signature will be changed by
454               end-of-line-translation filters, dropped zero bytes, dropped
455               high bits, or parity changes.)
456
457           Flags field
458               32-bit integer bit mask to denote important aspects of the file
459               format. Bits are numbered from 0 (LSB) to 31 (MSB). Note that
460               this field is stored in network byte order (most significant
461               byte first), as are all the integer fields used in the file
462               format. Bits 16-31 are reserved to denote critical file format
463               issues; a reader should abort if it finds an unexpected bit set
464               in this range. Bits 0-15 are reserved to signal
465               backwards-compatible format issues; a reader should simply
466               ignore any unexpected bits set in this range. Currently only
467               one flag bit is defined, and the rest must be zero:
468
469               Bit 16
470                   if 1, OIDs are included in the data; if 0, not
471
472           Header extension area length
473               32-bit integer, length in bytes of remainder of header, not
474               including self. Currently, this is zero, and the first tuple
475               follows immediately. Future changes to the format might allow
476               additional data to be present in the header. A reader should
477               silently skip over any header extension data it does not know
478               what to do with.
479
480           The header extension area is envisioned to contain a sequence of
481           self-identifying chunks. The flags field is not intended to tell
482           readers what is in the extension area. Specific design of header
483           extension contents is left for a later release.
484
485           This design allows for both backwards-compatible header additions
486           (add header extension chunks, or set low-order flag bits) and
487           non-backwards-compatible changes (set high-order flag bits to
488           signal such changes, and add supporting data to the extension area
489           if needed).
490
491       Tuples
492           Each tuple begins with a 16-bit integer count of the number of
493           fields in the tuple. (Presently, all tuples in a table will have
494           the same count, but that might not always be true.) Then, repeated
495           for each field in the tuple, there is a 32-bit length word followed
496           by that many bytes of field data. (The length word does not include
497           itself, and can be zero.) As a special case, -1 indicates a NULL
498           field value. No value bytes follow in the NULL case.
499
500           There is no alignment padding or any other extra data between
501           fields.
502
503           Presently, all data values in a binary-format file are assumed to
504           be in binary format (format code one). It is anticipated that a
505           future extension might add a header field that allows per-column
506           format codes to be specified.
507
508           To determine the appropriate binary format for the actual tuple
509           data you should consult the PostgreSQL source, in particular the
510           *send and *recv functions for each column's data type (typically
511           these functions are found in the src/backend/utils/adt/ directory
512           of the source distribution).
513
514           If OIDs are included in the file, the OID field immediately follows
515           the field-count word. It is a normal field except that it's not
516           included in the field-count. In particular it has a length word —
517           this will allow handling of 4-byte vs. 8-byte OIDs without too much
518           pain, and will allow OIDs to be shown as null if that ever proves
519           desirable.
520
521       File Trailer
522           The file trailer consists of a 16-bit integer word containing -1.
523           This is easily distinguished from a tuple's field-count word.
524
525           A reader should report an error if a field-count word is neither -1
526           nor the expected number of columns. This provides an extra check
527           against somehow getting out of sync with the data.
528

EXAMPLES

530       The following example copies a table to the client using the vertical
531       bar (|) as the field delimiter:
532
533           COPY country TO STDOUT (DELIMITER '|');
534
535       To copy data from a file into the country table:
536
537           COPY country FROM '/usr1/proj/bray/sql/country_data';
538
539       To copy into a file just the countries whose names start with 'A':
540
541           COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO '/usr1/proj/bray/sql/a_list_countries.copy';
542
543       To copy into a compressed file, you can pipe the output through an
544       external compression program:
545
546           COPY country TO PROGRAM 'gzip > /usr1/proj/bray/sql/country_data.gz';
547
548       Here is a sample of data suitable for copying into a table from STDIN:
549
550           AF      AFGHANISTAN
551           AL      ALBANIA
552           DZ      ALGERIA
553           ZM      ZAMBIA
554           ZW      ZIMBABWE
555
556       Note that the white space on each line is actually a tab character.
557
558       The following is the same data, output in binary format. The data is
559       shown after filtering through the Unix utility od -c. The table has
560       three columns; the first has type char(2), the second has type text,
561       and the third has type integer. All the rows have a null value in the
562       third column.
563
564           0000000   P   G   C   O   P   Y  \n 377  \r  \n  \0  \0  \0  \0  \0  \0
565           0000020  \0  \0  \0  \0 003  \0  \0  \0 002   A   F  \0  \0  \0 013   A
566           0000040   F   G   H   A   N   I   S   T   A   N 377 377 377 377  \0 003
567           0000060  \0  \0  \0 002   A   L  \0  \0  \0 007   A   L   B   A   N   I
568           0000100   A 377 377 377 377  \0 003  \0  \0  \0 002   D   Z  \0  \0  \0
569           0000120 007   A   L   G   E   R   I   A 377 377 377 377  \0 003  \0  \0
570           0000140  \0 002   Z   M  \0  \0  \0 006   Z   A   M   B   I   A 377 377
571           0000160 377 377  \0 003  \0  \0  \0 002   Z   W  \0  \0  \0  \b   Z   I
572           0000200   M   B   A   B   W   E 377 377 377 377 377 377
573

COMPATIBILITY

575       There is no COPY statement in the SQL standard.
576
577       The following syntax was used before PostgreSQL version 9.0 and is
578       still supported:
579
580           COPY table_name [ ( column_name [, ...] ) ]
581               FROM { 'filename' | STDIN }
582               [ [ WITH ]
583                     [ BINARY ]
584                     [ OIDS ]
585                     [ DELIMITER [ AS ] 'delimiter_character' ]
586                     [ NULL [ AS ] 'null string' ]
587                     [ CSV [ HEADER ]
588                           [ QUOTE [ AS ] 'quote_character' ]
589                           [ ESCAPE [ AS ] 'escape_character' ]
590                           [ FORCE NOT NULL column_name [, ...] ] ] ]
591
592           COPY { table_name [ ( column_name [, ...] ) ] | ( query ) }
593               TO { 'filename' | STDOUT }
594               [ [ WITH ]
595                     [ BINARY ]
596                     [ OIDS ]
597                     [ DELIMITER [ AS ] 'delimiter_character' ]
598                     [ NULL [ AS ] 'null string' ]
599                     [ CSV [ HEADER ]
600                           [ QUOTE [ AS ] 'quote_character' ]
601                           [ ESCAPE [ AS ] 'escape_character' ]
602                           [ FORCE QUOTE { column_name [, ...] | * } ] ] ]
603
604       Note that in this syntax, BINARY and CSV are treated as independent
605       keywords, not as arguments of a FORMAT option.
606
607       The following syntax was used before PostgreSQL version 7.3 and is
608       still supported:
609
610           COPY [ BINARY ] table_name [ WITH OIDS ]
611               FROM { 'filename' | STDIN }
612               [ [USING] DELIMITERS 'delimiter_character' ]
613               [ WITH NULL AS 'null_string' ]
614
615           COPY [ BINARY ] table_name [ WITH OIDS ]
616               TO { 'filename' | STDOUT }
617               [ [USING] DELIMITERS 'delimiter_character' ]
618               [ WITH NULL AS 'null_string' ]
619
620
621
622
623PostgreSQL 11.6                      2019                              COPY(7)
Impressum