I'm using PostgreSQL 9.1 on Ubuntu 12.04. The development machine has 2GB RAM and it's a Centrino Duo.
The Backup command is pg_dump and takes less than 5 seconds to run from the terminal.
But my restore is done like this:
/usr/bin/psql --host localhost --port 5432 --username "postgres" --quiet "dbHRS" < "t2"
The text file "t2" has around 5000 lines of inserts. But it takes around 2 minutes to complete.
Why does it take this long? Is there something I can do to make it faster?
ADDITIONAL INFO: The Backup was done like this:
/usr/bin/pg_dump --host localhost --port 5432 --username "postgres" --role "mizk" --no-password --format plain --data-only --inserts --column-inserts --verbose --file "abc" "dbHRS"
So the file abc contains JUST A SET OF INSERT QUERIES. That's ALL. No stored procs, no triggers...
I cannot accept the slowness to restore. What's strange is that when I copy-paste the text file's contents into a query window on PG-Admin, it's pretty fast. Just a couple of seconds. So I think it's got to do with the way the psql command works. Maybe I'm wrong.