pgpv
pgpv

Reputation: 385

Dumping a DB without pg_dump

Is there any way to dump a postgres db using psql only ( without pg_dump )? Thanks.

Upvotes: 20

Views: 8390

Answers (2)

Michael Krelin - hacker
Michael Krelin - hacker

Reputation: 143061

Theoretically you have access to all the data needed. In practice you're more likely to be able to dump/save some data using COPY command, but not the database schema, etc.

Note, that you do not have to have pg_dump on the same machine where your database server is, if it listens to the network. But well, I don't know why you even ask :)

Upvotes: 4

PinnyM
PinnyM

Reputation: 35533

In theory you could run queries to extract the schema and then use those results to extract the data. But it wouldn't be easy to manipulate all of that into something usable for a restore using just psql.

Upvotes: 2

Related Questions