Skip to content

kakusuke/embulk-output-postgres-udf

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
ci
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PostgreSQL UDF output plugin for Embulk

Dumps records to PostgreSQL via user-defined function.

Overview

  • Plugin type: output
  • Resume supported: no

Configuration

  • host: database host name description (string, required)
  • port: database port number (integer, default: 5432)
  • user: database login user name (string, required)
  • password: database login password (string, default: "")
  • database: destination database name (string, required)
  • schema: database login password (string, default: "public")
  • function: function body (string, required)
  • language: function language (string, default: "plpgsql")

Example

in:
  type: file
  path_prefix: /path/to/csv/sample_
  parser:
    charset: UTF-8
    newline: CRLF
    type: csv
    delimiter: ','
    quote: '"'
    escape: ''
    skip_header_lines: 1
    columns:
    - {name: id, type: long}
    - {name: account, type: long}
    - {name: time, type: timestamp, format: '%Y-%m-%d %H:%M:%S'}
    - {name: purchase, type: timestamp, format: '%Y%m%d'}
    - {name: comment, type: string}
out:
  type: postgres_udf
  host: localhost
  user: postgres
  database: postgres
  function: |
    begin
      begin
        create table if not exists sample (
          id integer,
          account integer,
          time timestamp,
          purchase timestamp,
          comment text
        );
      exception
        when unique_violation then -- do nothing
      end;
      insert into sample values(id, account, time, purchase, comment);
    end;

Build

$ ./gradlew gem

About

PostgreSQL UDF output plugin for Embulk

Resources

License

Stars

Watchers

Forks

Packages

No packages published