LoginSignup
0
0

More than 1 year has passed since last update.

【Embulk】embulk-output-postgresqlで出力先のテーブルに主キーを設定する。

Posted at

実施したいこと

  • embulk-output-postgresqlで出力先のテーブルに主キーを設定する。

必要なプラグイン

  • embulk-output-postgresql

設定方法

  • config.ymlにcreate_table_constraintを追加する。以下の記述によりhoge1,hoge2,hoge3を複合主キーとしたhoge_tableにデータが登録される。
config.yml
out:
  type: postgresql
  mode: truncate_insert
  default_timezone: "Asia/Tokyo"
  host: "192.168.1.XXX"
  port: 5432
  user: XXXX
  password: XXX
  database: XXX
  schema: XXX
  table: hoge_table
  create_table_constraint: 'PRIMARY KEY (hoge1,hoge2,hoge3)'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0