I currently have created a database via Supabase, which uses the Postgres database. After doing so, I then downloaded Postgres on my computer, which gave me the psql command line script for use to connect to postgres databases.
I intend to create a local backup of my Supabase database through the psql script. This is after I have connected to the supabase database through psql

From this, i can see that psql successfully connected to the database.
I then tried to use the pg_dump command to attempt to create a dump file of the database. This was the command I used:
pg_dump postgresql://postgres:[Database password]@db.epvzhrganrzfwexmiksg.supabase.co:5432/postgres > dumpfile.sql
However, after I pressed enter, psql did not run the command, it simply moved to a new command line. As such, I am not sure whether I inputted something wrong for the dump command or is it a different psql command I need to use for it.
As mentioned, you have successfully connected with psql.
From OS prompt
$ pg_dump mydb > mydb.sql
From psql prompt
postgres# \! pg_dump mydb > mydb.sql
Post backup done , mydb.sql file can be copied & import via psql to local machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With