DEV Community

01kg
01kg

Posted on

Supabase | cannot insert a non-DEFAULT value into column

Full Error:

PostgrestException(message: cannot
 insert a non-DEFAULT value into 
column "id", code: 428C9, details: 
Column "id" is an identity column 
defined as GENERATED ALWAYS., hint: 
Use OVERRIDING SYSTEM VALUE to override.)
Enter fullscreen mode Exit fullscreen mode

Table:

create table dog (
  id bigint generated always as identity primary key,
  name text,
  description text,
  user_id uuid references auth.users on delete cascade on update cascade
);
Enter fullscreen mode Exit fullscreen mode

Solution

According to this answer, no way to use OVERRIDING SYSTEM VALUE in Supabase.

Should use generated by default while creating "id" field.

Top comments (0)