Upsert not working because of error Column id is an identity column defined as GENERATED ALWAYS.

I'm trying to do an upsert on a post, this is returning this error:

code: "428C9"
details: "Column \"id\" is an identity column defined as GENERATED ALWAYS."
hint: "Use OVERRIDING SYSTEM VALUE to override."
message: "cannot insert a non-DEFAULT value into column \"id\""


Is there a setting I need to adjust for making this work? I'm using supabase-js to do the upsert.

const { data, error } = await supabase
      .from("posts")
      .upsert({ ...form, price: Number(form.price) * 100 }) // price in cents
      .single();
Was this page helpful?