python api to backup/restore data

Started by Acmover 18 years ago3 messagesgeneral
Jump to latest
#1Acm
alextabone@gmail.com

I am working with Postgresql 8.2.4 and Python 2.5.

I would like to know whether an API for accessing Postgresql from
Python exists and whether or not it supports commands for backing up a
database (or schema) and restoring a backup file.

I heard about psycopg and psycopg2 but have no idea of how to use them
for backup/restore operations.

Thank you.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Acm (#1)
Re: python api to backup/restore data

Acm <alextabone@gmail.com> writes:

I would like to know whether an API for accessing Postgresql from
Python exists and whether or not it supports commands for backing up a
database (or schema) and restoring a backup file.

Run pg_dump or pg_restore as a subprocess.

regards, tom lane

#3Ron Johnson
ron.l.johnson@cox.net
In reply to: Tom Lane (#2)
Re: python api to backup/restore data

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/04/07 10:58, Tom Lane wrote:

Acm <alextabone@gmail.com> writes:

I would like to know whether an API for accessing Postgresql from
Python exists and whether or not it supports commands for backing up a
database (or schema) and restoring a backup file.

Run pg_dump or pg_restore as a subprocess.

But that doesn't give you the capability of getting customized output.

- --
Ron Johnson, Jr.
Jefferson LA USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGtMMQS9HxQb37XmcRArvxAKDo0VQvq1uBtCEUYYb3+FSWNKmCYACfckSV
f7gaTsz/mAbEzFH0IJIypI0=
=WAls
-----END PGP SIGNATURE-----