CopyIn ​Copy​In

yaml
type: "io.kestra.plugin.jdbc.postgresql.copyin"
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
SubType string
SubType string
SubType string
SubType string
Default TEXT
Possible Values
TEXTCSVBINARY
Default false
Possible Values
DISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULL