Unable to run `pg_dump` when following migrating between projects documentation
See original GitHub issueImprove documentation
Link
https://supabase.io/docs/guides/database#migrating-between-projects
Describe the problem
I’m trying to add restoration support for Supabase in https://snaplet.dev, but whilst trying to dump the database I get the following error:
$ pg_dump -h db.PROJECT_REF.supabase.co -U postgres --clean --schema-only M> supabase_schema.sql
pg_dump: error: query failed: ERROR: permission denied for table migrations
pg_dump: error: query was: LOCK TABLE storage.migrations IN ACCESS SHARE MODE
I can exclude the storage
schema, but it would be nice to have a completely functioning restoration.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Documentation: 15: pg_dump - PostgreSQL
Description. pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently....
Read more >pg_dump and pg_restore - Database Migration Guide
It produces a set of SQL statements that you can run to reproduce the original database object definitions and table data. The pg_dump...
Read more >Migrate to Aiven for PostgreSQL® with pg_dump and pg_restore
This type of error is often related to the lack of superuser-level privileges blocking non-essential queries. A typical example is due to failing...
Read more >Bamboo fails to start after PostgreSQL migration with error ...
Migrate PostgreSQL server through pg_dump to another server; Configure bamboo.cfg.xml to refer to the new PostgreSQL server. The following ...
Read more >PostgreSQL Migration with Database Migration Service
Start the data migration after you complete and successfully test your ... instance restart that you can't avoid, the document indicates it.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@relferreira - but then once the dump is finished, it’s very important to then switch back:
@TomasHubelbauer adding
-N auth -N realtime
didn’t solve the original issue that @peterp reported for me, i.e.:In this case I also had to add
-N supabase_functions
(though probably not ideal for when you want to fully inspect a dump) I raised another issue here that is related: https://github.com/supabase/supabase/issues/7865 it’s unclear to me whySUPERUSER
is needed at all, I don’t remember that being a part of the dump workflow when I’ve worked with Postgres previously…For anyone who’s looking to just dump/backup all their Supabase database data to have a local backup and do not care about the
auth
andrealtime
schema contents:You’ll be asked for the password you set during the setup of your Supabase project. If you don’t have
pg_dump
, do not want to install full Postgres locally and are a macOS user, look into https://postgresapp.com/ (https://github.com/PostgresApp/PostgresApp) - you can skip the database initialization step and just add the CLI tools to your command line.