filename
filename
or program
must be specified, but not both.program
COPY FROM PROGRAM
were used. Either program
or filename
must be specified, but not both.format
COPY
's FORMAT
option.header
COPY
's HEADER
option.delimiter
COPY
's DELIMITER
option.quote
COPY
's QUOTE
option.escape
COPY
's ESCAPE
option.null
COPY
's NULL
option.encoding
COPY
's ENCODING
option.COPY
allows options such as HEADER
to be specified without a corresponding value, the foreign table option syntax requires a value to be present in all cases. To activate COPY
options typically written without a value, you can pass the value TRUE, since all such options are Booleans.force_not_null
null
option). This has the same effect as listing the column in COPY
's FORCE_NOT_NULL
option.force_null
NULL
even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL
. This has the same effect as listing the column in COPY
's FORCE_NULL
option.COPY
's FORCE_QUOTE
option is currently not supported by file_fdw
.file_fdw
foreign-data wrapper, nor in the options of a server or user mapping using the wrapper.pg_read_server_files
(to use a filename) or the default role pg_execute_server_program
(to use a program), for security reasons: only certain users should be able to control which file is read or which program is run. In principle regular users could be allowed to change the other options, but that's not supported at present.program
option, keep in mind that the option string is executed by the shell. If you need to pass any arguments to the command that come from an untrusted source, you must be careful to strip or escape any characters that might have special meaning to the shell. For security reasons, it is best to use a fixed command string, or at least avoid passing any user input in it.file_fdw
, EXPLAIN
shows the name of the file to be read or program to be run. For a file, unless COSTS OFF
is specified, the file size (in bytes) is shown as well.