That removes the users, but to update the instance stats there's one more step (thank you @sunaurus@lemm.ee):
- Log in to postgres as before
- Execute:
update site_aggregates
set users = (select count(*) from local_user)
where site_id = 1;
This will force an update to the instance stats, so the bots that you removed won't show up as users. This is important as people may not wish to federate or interact with instances that appear to mostly consist of bots.