CopyOut
Copy tabular data from a PostgreSQL table to a file.
type: "io.kestra.plugin.jdbc.postgresql.CopyOut"
Export a PostgreSQL table or query to a CSV or TSV file.
id: postgres_copy_out
namespace: company.team
tasks:
- id: copy_out
type: io.kestra.plugin.jdbc.postgresql.CopyOut
url: jdbc:postgresql://127.0.0.1:56982/
username: pg_user
password: pg_password
format: CSV
sql: SELECT 1 AS int, 't'::bool AS bool UNION SELECT 2 AS int, 'f'::bool AS bool
header: true
delimiter: "\t"
The JDBC URL to connect to the database.
An optional list of columns to be copied.
If no column list is specified, all columns of the table will be copied.
Specifies that the file is encoded in the encoding_name.
If this option is omitted, the current client encoding is used. See the Notes below for more details.
Do not match the specified columns' values against the null string.
In the default case where the null string is empty, this means that empty values will be read as zero-length strings rather than nulls, even when they are not quoted. This option is allowed only in COPY FROM, and only when using CSV format.
Match the specified columns' values against the null string, even if it has been quoted, and if a match is found set the value to NULL.
In the default case where the null string is empty, this converts a quoted empty string into NULL. This option is allowed only in COPY FROM, and only when using CSV format.
Forces quoting to be used for all non-NULL values in each specified column.
NULL output is never quoted. If * is specified, non-NULL values will be quoted in all columns. This option is allowed only in COPY TO, and only when using CSV format.
Selects the data format to be read or written.
Specifies the string that represents a null value.
The default is \N (backslash-N) in text format, and an unquoted empty string in CSV format. You might prefer an empty string even in text format for cases where you don't want to distinguish nulls from empty strings. This option is not allowed when using binary format.
The database user's password.
A SELECT, VALUES, INSERT, UPDATE or DELETE command whose results are to be copied.
For INSERT, UPDATE and DELETE queries a RETURNING clause must be provided, and the target relation must not have a conditional rule, nor an ALSO rule, nor an INSTEAD rule that expands to multiple statements.
The SSL cert.
Must be a PEM encoded certificate
The SSL key.
Must be a PEM encoded key
The SSL key password.
The SSL mode.
The SSL root cert.
Must be a PEM encoded certificate
The name (optionally schema-qualified) of an existing table.
The database user.
The rows count from this COPY
.
The URI of the result file on Kestra's internal storage.