0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

DBeaverでCSVをインポートしようとしたら外部キー制約に阻まれた時に見てほしい

Posted at

こんな状況になった人向けの記事

  • DBeaverで外部キー制約のあるテーブルへCSVをインポートしようとして失敗した人
  • CSVの値自体は外部キー制約に違反していないのになぜかエラーになる
  • SQLを書いて値の挿入は問題なくできる

可能性のある原因

NULLとしてインポートしたいカラムが空文字としてインポートされようとしている。 親テーブルに空文字は無いため、外部キー制約違反となっているのかも。

解決方法

CSVのインポート設定で「Set empty strings to NULL」にチェックを入れてください。
image.png

お詫び

あくまで本記事は解決方法の1案を示すものです。他の原因であることも十分考えられますのでその点はお許しください。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?