N
N
nicolaychuchka2019-01-18 11:57:08
Python
nicolaychuchka, 2019-01-18 11:57:08

How to make a backup of the entire PostgeSQL database in Python?

Actually a question in a subject. windows 7, visual studio 2017, PostgreSQL 11, Python 3.6.
I connect to the database using the psycopg2 library.
You need a backup of the entire database, not a separate table. Through the console, through pg_dump everything is backed up, now I want to use python. I'm not strong in python, that's why I turn here for a hint:
I came across an article https://medium.com/poka-techblog/5-different-ways-... considered the first two ways:
1) The first option is generally poorly understood, not I even see that the database would be indicated in some way, etc., maybe I don’t understand something, I’m waiting for any advice and tips.
2) In the second case, there was a problem initially with the fact that the sh library is not supported on windows, I connected it with grief in half (https://stackoverflow.com/questions/28618906/porti... but I don't know how to import pg_dump itself there now.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2019-01-19
@alfss

https://stackoverflow.com/questions/204017/how-do-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question