We use PostgreSQL at work for a database, together with MySQL. So today I set about setting up PostgreSQL database on my laptop, one I will use for development work on my laptop. I'm running SuSE 9.1 on the laptop, and I chose to go the easy route, and install PostgreSQL through the prepackaged files. I've got Yast configured (SuSE's configuration program) so that to install software the program just goes of to a mirror, and downloads the packages that I want installed. This saves me the hassle of carrying around CD's all the time. And I am not doing a complete install of SuSE on a 20 gig hard drive. I should have space for some Mp3's after all ;)
Once all the postgreSQL rpm's had been downloaded and installed, I took the following steps:
export $PGDATA=/usr/local/pgsql/data
export PGDATA=/usr/local/pgsql/data
initdb
After editing the pg_hba.conf (which was located in /usr/local/pgsql/data) I did the following:
psql database_name user_name
I may have had to do a createdb database_name but I dont remember. Then I went ahead and downloaded the pg_dumpall > complete_dump_of_database.sql from the server. To dump it back onto my laptop I did:
psql database_name < complete_dump_of_database.sql
That was it. That did it, and now I have the database running locally.
(I may have forgotten some steps inbetween... not too sure... but next time I am doing this I'll take more detailed notes)