how to pg_restore a supabase db

I am about to deploy a large number of migrations. Before doing that i would like to test them one more time against prod database but on localhost.

I have pg_dumpall my prod instance.
Running
supabase start
pg_restore -cC -d postgres -e ./postgres.custom

gives
pg_restore: from TOC entry 3540; 1262 12974 DATABASE postgres postgres
pg_restore: error: could not execute query: ERROR:  cannot drop the currently open database

When i psql and
create database temp;
\c temp;
drop database postgres with (force);

I get
ERROR:  database "postgres" is used by an active logical replication slot
DETAIL:  There is 1 active slot.

but pg_subscription is empty.

How can i restore a database from a backup?
Was this page helpful?