Skip to main content

2 months ago

pg_dump error

I'm following along with the lecture "Interacting with External Processes: Utilizing `pg_dump`" in the "Introduction to Python Development" course. I run the line

dump = pgdump.dump('postgres://pguser:pgpassword@')

using my username, password and IP address but I get the error "pg_dump: server version: 9.6.8; pg_dump version 9.2.24

pg_dump: aborting because of server version mismatch

pg_dump: [archiver (db)] connection to database "sample" failed: could not connect to server: Connection timed out. "

I installed postgres9.6 as instructed in a previous lecture but when I check the version with psql -V it shows 9.2.24

Image of
2 months ago
It sounds like you may have a path set where it is finiding an older version. Make sure the binary commands are only in one place and that the directory where they are is first in your path.