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
columns array
SubType string
delimiter string
encoding string
escape string
forceNotNull array
SubType string
forceNull array
SubType string
forceQuote array
SubType string
format string
Default
TEXT
Possible Values
TEXT
CSV
BINARY
freeze booleanstring
header booleanstring
nullString string
oids booleanstring
password string
quote string
ssl booleanstring
Default
false
sslCert string
sslKey string
sslKeyPassword string
sslMode string
Possible Values
DISABLE
ALLOW
PREFER
REQUIRE
VERIFY_CA
VERIFY_FULL