FATAL: 28P01: password authentication failed for user "postgres"
im using supabase cli locally, but i want to change the database password, and i changed but now the supabase studio is not working as its using the old password, how can i update the password in supabase studio ?
for context i used supabase cli to create the supabase project with "supabase start"
and changed password with this command:
alter user anon with password '${new_passwd}';
alter user authenticated with password '${new_passwd}';
alter user authenticator with password '${new_passwd}';
alter user dashboard_user with password '${new_passwd}';
alter user pgbouncer with password '${new_passwd}';
alter user postgres with password '${new_passwd}';
alter user service_role with password '${new_passwd}';
alter user supabase_admin with password '${new_passwd}';
alter user supabase_auth_admin with password '${new_passwd}';
alter user supabase_functions_admin with password '${new_passwd}';
alter user supabase_read_only_user with password '${new_passwd}';
alter user supabase_replication_admin with password '${new_passwd}';
alter user supabase_storage_admin with password '${new_passwd}';
drop schema _supavisor CASCADE;
create schema if not exists _supavisor;
alter schema _supavisor owner to supabase_admin;
DO $$
BEGIN
IF EXISTS (
SELECT 1
FROM information_schema.tables
WHERE table_schema = '_analytics'
AND table_name = 'source_backends'
) THEN
UPDATE _analytics.source_backends
SET config = jsonb_set(
config,
'{url}',
'"postgresql://supabase_admin:${new_passwd}@db:5432/postgres"',
false
)
WHERE type = 'postgres';
END IF;
END
$$;

1 Reply
You only changed password in db. But studio and other services in stack are still using old password
postgres because its hardcoded in supabase cli
If you want full control, then you should use self-hosted docker-compose version