Search code examples
postgresqlsupabasepg-dumpsupabase-database

Unable to pg_dump from supabase project


First of all, for some reason, pg_restore works. But when I try pg_dump, I get this error:

pg_dump: error: connection to server at "aws-0-ap-southeast-1.pooler.supabase.com" (52.74.252.201), port 5432 failed: received invalid response to GSSAPI negotiation: S

the command I used: pg_dump postgres -h aws-0-ap-southeast-1.pooler.supabase.com -p 5432 -U postgres.[censored] -f pg_dumps/test_climbjios_prod_dump.dump -Fc

pg_dump --version:

pg_dump (PostgreSQL) 15.1

The only time I've seen that "GSSAPI negotiation" thing is when I tried to connect to my Supabase project using PgAdmin 4, which I eventually solved by adding the SSL certificate. So I tried that as described here: pg_dump -d 'sslmode=require sslcert=prod-ca-2021.crt host=aws-0-ap-southeast-1.pooler.supabase.com' -p 5432 -U postgres.[censored]-F c -f pgdumps/prod_dump_0803241509.dump

... but I still got the same error message. Any help?


Solution

  • Turns out I just had to use the latest version of pg_dump (PostgreSQL 16 at the point of writing) instead of the one I was using which was from PostgreSQL 14