Reputation: 575
In Microsoft SQL Server, it just simple to backup database:
BACKUP DATABASE my_database TO DISK my_zip_file
Is it possible to backup PostgreSQL (9.0.1) database as a simple is that?
If posible, what is the script?
Upvotes: 0
Views: 202
Reputation: 324375
No, there is no such feature in PostgreSQL. You need to do it using the pg_dump
shell command, which makes its own connection to PostgreSQL, or using a tool like pg_basebackup
if you want a physical DB copy. Supported backup methods are documented in the manual.
You can stream individual tables to the client via COPY
, but that's about it.
I'd be nice if the DB supported backup over the database protocol, but it doesn't, and there's no work currently happening to add such a feature. For this sort of thing what's needed is a person or team who really wants the feature, and is willing to put in the time required to develop it, or fund others to develop it. For "utility" features like this, there usually isn't anyone willing to step up and do the work or fund it.
Search for "libpgdump", "postgresql server-side dump", "pg_dump library", etc to learn more about past discussions on this topic.
(Even if it did, it wouldn't support it in the old, known-buggy version you're using. You're 14 patch releases behind, update to 9.0.15.)
Upvotes: 1