Python api for postgresql pg_dump *, recovery command

Is there a python library that contains the functions of the pg_dump, pg_dumpall and restore commands? I want to be able to handle exceptions if standard commands do not allow this level of control.

Is there anything here that can help me?

+4
source share
1 answer

You can try psycopg2 . This is the python api for postgres, and you can use copy_from and copy_to on the cursor to do this with StringIO objects and do it all in memory or just with a disk.

This is only useful for data, though, I suppose.

+1
source

Source: https://habr.com/ru/post/1387576/


All Articles