20

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

asked Feb 24, 2012 at 15:18
2
  • Why would you want to do that? Commented Feb 24, 2012 at 21:17
  • 3
    If the system you have access to, say a locked down Docker container, only has an older version of pg_dump you may run into a Pg server version mismatch Commented Jan 22, 2021 at 19:33

2 Answers 2

4

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 :)

answered Feb 24, 2012 at 15:47
Sign up to request clarification or add additional context in comments.

1 Comment

well, it was mostly curiosity.
2

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.

answered Feb 24, 2012 at 15:24

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.