I'm trying to export a PostgreSQL database from phpPgAdmin and for some reason it's dumping out an empty SQL file.

The database is definitely not empty.

To export it I am clicking on the database, then export, then selecting structure and data.

Any idea why this would be? Thanks

link|improve this question

70% accept rate
1  
Can you export the same database using the same username from the command line? – Khaled Nov 19 '10 at 11:07
Logs would also be relevant here (Apache, and phppgAdmin logs if it uses them). It may be hitting an error in the export. – Andrew M. Nov 19 '10 at 13:05
I managed to export it from the command line, there must be some sort of error in my phpPgAdmin I think. Thanks! – Probocop Nov 19 '10 at 13:38
feedback

2 Answers

up vote 0 down vote accepted

I managed to export it from the command line using:

./pg_dump -U postgres -c -f /htdocs/databasename.sql databasename
link|improve this answer
You may not want to dump your db into the webroot, even if you've obfuscated the name. – Dana the Sane Sep 12 '11 at 14:46
feedback

I had the same problem and checked my log:

/usr/lib/postgresql/8.4/bin/pg_dump: invalid option -- 'd'
Try "pg_dump --help" for more information.

phpPgAdmin uses the option -d, wich was deprecated in 2009, so I edited dbexport.php and replaced the "-d" with "--inserts", now it works just fine :D!

http://archives.postgresql.org/message-id/49B53447.30402@endpoint.com

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.