Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
2  
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

3 Answers 3

up vote 1 down vote accepted

I managed to export it from the command line using:

./pg_dump -U postgres -c -f /htdocs/databasename.sql databasename
share|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

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

share|improve this answer

In the export interface, choose export type "SQL" would return an empty file. Selecting "export type" as "COPY" is the right choice here - it return the dump sql file.

But I also think that phppgadmin sucks enough for us to use the command line instead. For example, it would fail but report no error if you upload an sql file exceeding the allowed upload file size (often ~ 2MB).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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