PHP Classes

PostgreSQL Backup and Restore: Backup and restore PostgreSQL databases with files

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 70%Total: 1,978 All time: 1,987 This week: 404Up
Version License PHP version Categories
pgbackuprestore 1.0.0Public Domain4.0Databases, Systems administration


This class can be used to generate backups of PostgreSQL.

It accesses a given database and generates SQL statements that can be used to recreate the database tables and the values stored on their rows. The generated SQL is stored in a given file.

The class can also restore a database from a previously generated backup by executing the SQL statements stored in a backup file.

Innovation Award
PHP Programming Innovation award nominee
September 2007
Number 9
PostgreSQL is a very popular Open Source database. It may not be as popular as MySQL, but it has many users that prefer PostgreSQL over MySQL.

There are plenty of tools and components that generate backup copies of MySQL databases by generating SQL statements to recreate the tables and contents of their records. However, for PostgreSQL the offer of similar tools is scarce.

This class addresses that gap by providing to PosgreSQL users a similar solution based only on pure PHP code.

Manuel Lemos
Picture of Michele Brodoloni
  Performance   Level  
Name: Michele Brodoloni <contact>
Classes: 6 packages by
Country: Ireland Ireland
Age: 37
All time rank: 2491 in Ireland Ireland
Week rank: 578 Down1 in Ireland Ireland Equal
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example
Plain text file pgBackupRestore.class.php Class Class file
Plain text file pgBackupRestore2.class.php Class New class file!

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:1,987
This week:404Up
User Ratings User Comments (3)
 All time
6 years ago (jesus rodriguez)
the sql file generated by backup class doesnt works to restor...
9 years ago (Alone Nascimento)
very good and useful class.
14 years ago (Ji&#345;)