1
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?

SupabaseでNOT NULL設定時のエラー解決方法

Posted at

SupabaseでカラムにNOT NULLをテーブルのカラム内で設定しようとした際に以下のエラーが発生しました。

スクリーンショット 2025-01-26 12.20.55.png

エラー内容

failed to update pg.columns with the given ID: invalid input syntax for type integer: "non-null"

スクリーンショット 2025-01-26 12.15.46.png

原因

SupabaseのGUIで「NOT NULL」を設定する際に、Is Nullableのチェックを外さずに値や設定を変更していたためエラーが発生しました。

Is Nullableが有効な場合(チェックが付いている状態)、NULLが許可されるため、設定に矛盾が生じていたようです

解決までの手順

  1. Supabaseのテーブル編集画面で該当カラムの**設定アイコン(⚙️)**をクリック。
  2. Is Nullableのチェックを外す
  3. 変更を保存。
    スクリーンショット 2025-01-26 12.26.06.png

これで、該当カラムにNOT NULL制約が適用され、NULL値を許可しないようになりました。

1
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
1
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?