
CopyIn
CopyIn
yaml
type: "io.kestra.plugin.jdbc.postgresql.CopyIn"Examples
yaml
id: postgres_copy_in
namespace: company.team
tasks:
- id: copy_in
type: io.kestra.plugin.jdbc.postgresql.CopyIn
url: jdbc:postgresql://127.0.0.1:5432/
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
format: CSV
from: "{{ outputs.export.uri }}"
table: my_destination_table
header: true
delimiter: "\t"
yaml
id: postgres_copyin
namespace: company.team
tasks:
- id: download_products
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/products.csv
- id: create_products_table
type: io.kestra.plugin.jdbc.postgresql.Query
url: "jdbc:postgresql://{{ secret('POSTGRES_HOST') }}:5432/postgres"
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
sql: |
CREATE TABLE IF NOT EXISTS products(
product_id varchar(5),
product_name varchar(100),
product_category varchar(50),
brand varchar(50)
);
- id: copyin_products
type: io.kestra.plugin.jdbc.postgresql.CopyIn
url: "jdbc:postgresql://{{ secret('POSTGRES_HOST') }}:5432/postgres"
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
format: CSV
from: "{{ outputs.download_products.uri }}"
table: products
header: true
delimiter: ","
Properties
from*Requiredstring
url*Requiredstring
columnsarray
SubTypestring
delimiterstring
encodingstring
escapestring
forceNotNullarray
SubTypestring
forceNullarray
SubTypestring
forceQuotearray
SubTypestring
formatstring
Default
TEXTPossible Values
TEXTCSVBINARYfreezebooleanstring
headerbooleanstring
nullStringstring
oidsbooleanstring
passwordstring
quotestring
sslbooleanstring
Default
falsesslCertstring
sslKeystring
sslKeyPasswordstring
sslModestring
Possible Values
DISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULLsslRootCertstring
tablestring
usernamestring
Outputs
rowCountinteger
Metrics
rowscounter
Unit
rows