basically, just download and config , then make && make install.
- Download the latest and stable source from Postgresql Site
wget http://wwwmaster.postgresql.org/redir/407/h/source/v9.0.3/postgresql-9.0.3.tar.gz |
- Unzip the tarball file.
tar -zxf postgresql-9.0.3.tar.gz |
- run the config, make sure prerequisites are there
yum install openssl-devel ./configure –help # list all options to run the compilation, you can override the installation folder using the –-pre-fix options. you can also just run ./configure , it will pick up all default options. |
- make and make install
make && make install |
- make sure it’s installed without error, add the bin folder to profile , then we can initialize the db.
In /etc/profile or ~/.profile |
- Create postgres user and init the db
useradd postgres mkdir /usr/local/psql/data chown postgres /usr/local/psql/data |
- start the service and client
Now, DB server is ready, we can use the postgres which is a superuser to create some database.
Su – postgres psql \l will list all the database. Create database HelloDB; Create database helloDB; #connect helloDb \c helloDB; |
Here,let’s download some sample data from http://pgfoundry.org/projects/dbsamples/
world-1.0.tar.gz
upzip and use \I to install the db from the sql .
table city, will list all rows in city table.
I will write a C# application using the standard ado.net library to read the city table.
1 comment:
I want to install postgreSQL on my CentOS, thanks already to guide how to install.
Post a Comment