Permission error when backing up the database with `pg_dump`
See original GitHub issueBug report
Describe the bug
I have a project that I need to make a local backup of, I have database triggers and functions.
When I tried this command pg_dump 'postgresql://postgres:password@db.id.supabase.co:5432/postgres' > backup.sql
It gave me this error:
pg_dump: error: query failed: ERROR: permission denied for table hooks
pg_dump: error: query was: LOCK TABLE supabase_functions.hooks IN ACCESS SHARE MODE
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a database function with trigger type
- Create a database trigger that fires that function
- Try
pg_dump
- See error
Expected behavior
Backup to be completed
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: Linux
- Browser Firefox
- Version of supabase-js: 2.2.0
- Version of Node.js: v19.2.0
Additional context
I did NOT mess with permissions, I also tried DBeaver and faced the same issue
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Postgresql dump permission denied
I wrestled with this "Permission Denied" issue while trying to backup my PSQL database on an Ubuntu machine for a long time, and...
Read more >"Permission denied" error when using pg_dump to backup ...
Hello, I m trying to make backup. i have master password and i double confirm ... in "Manage Databases". it shows popup message...
Read more >pg_dump permission denied for sequence
My guess that this is simply a permission issue towards the object that is attempted to be dumped. Excluding the sequence would work...
Read more >pg_dump fails with 'permission denied for table audits' - GitLab
When trying to backup our GitLab CE 13.7.3 instance (Omnibus, docker container), the process fails. We have successfully executed (many) backups ...
Read more >Permission denied for sequence jobid_seq when trying to ...
I am trying to perform a backup of my database in Azure Database for ... pg_dump: error: query failed: ERROR: permission denied for...
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
awesome, then i changed my dump to
i also gzip this file after
full script here
Thanks @Geczy , but for a better approach, I used these extra options
-F c -v -f db.dump
to be able to restore it withpg_restore