© 2026 Hedgehog Software, LLC

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

Help with a trigger + function

I'm a noob in this area. Given the following schema...
create table games (
  id uuid primary key DEFAULT gen_random_uuid(),
  name text,
  players_min int default 0,
  players_conf int default 0,
  game_on boolean not null default false
);
create table games (
  id uuid primary key DEFAULT gen_random_uuid(),
  name text,
  players_min int default 0,
  players_conf int default 0,
  game_on boolean not null default false
);

I want to change
game_on
game_on
to
true
true
when
players_conf
players_conf
(confirmed) is equal to or greater than
players_min
players_min
. (Conversely, if
players_conf
players_conf
becomes less than
players_min
players_min
,
game_on
game_on
should be changed to
false
false
.) Basically, on
update
update
, I want to run this condition and potential update to run. But... how. Still learning
PGSQL
PGSQL
.
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

Trigger function help
SupabaseSSupabase / help-and-questions
3y ago
Help with a trigger
SupabaseSSupabase / help-and-questions
4y ago
Trigger Function
SupabaseSSupabase / help-and-questions
4y ago
Edge function <> Trigger
SupabaseSSupabase / help-and-questions
13mo ago