basically, just download and config , then make && make install.
- Download the latest and stable source from Postgresql Site
- 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 |
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 |
\l will list all the database.
Create database HelloDB;
Create database helloDB;
Here,let’s download some sample data from http://pgfoundry.org/projects/dbsamples/
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.