© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
4 replies
Smardrengr

“UPDATE requires a WHERE clause”

Even when I try to
insert
insert
a row in a table that, FWIW, has a constraint on two columns, e.g.:

create table players (
  id uuid primary key DEFAULT gen_random_uuid(),
  created_at timestamp with time zone default now(),
  updated_at timestamp with time zone,
  user_id uuid not null references auth.users,
  game_id uuid not null references games(id),
  num int default 0,
  unique(user_id, game_id)
);
create table players (
  id uuid primary key DEFAULT gen_random_uuid(),
  created_at timestamp with time zone default now(),
  updated_at timestamp with time zone,
  user_id uuid not null references auth.users,
  game_id uuid not null references games(id),
  num int default 0,
  unique(user_id, game_id)
);

supabaseClient returns the error
{
  code: '21000',
  details: null,
  hint: null,
  message: 'UPDATE requires a WHERE clause'
}
{
  code: '21000',
  details: null,
  hint: null,
  message: 'UPDATE requires a WHERE clause'
}

Any ideas? (Upserting fails too the same way.)
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Updated to Supabase V2 not getting 'UPDATE requires a WHERE clause' on update functions.
SupabaseSSupabase / help-and-questions
4y ago
Comparing Arrays in Where or Having Clause
SupabaseSSupabase / help-and-questions
4y ago
'Failed to run sql query column 'where clause argument' does not exist'
SupabaseSSupabase / help-and-questions
4y ago
Select clause with interval
SupabaseSSupabase / help-and-questions
4y ago