1. Download the PostgreSQL source package and save it to a directory on the Linux operating system
2. Extract the PostgreSQL source bundle: Tar zxvf postgresql-9.2.4.tar.gz
or tar jxvf postgresql-9.2.4.tar.bz2
3. Switch to the directory you just unzipped: CD postgresql-9.2.4
4../configure
If you encounter an error, you will need to install the Dependent Toolkit as follows (Install on demand)
Yum Install GCC
Yum Install ReadLine
Yum Install Flex
Yum Install zlib
In the execution./configure
Gmake World
Gmake Install-world
Installation Complete
Then start the database
To the installation directory (default is/usr/local/postgres)
Set up the data directory under this directory (storing database related files)
Starting a database requires a non-root user
/usr/local/pgsql//bin
Initializing the database
./initdb-d. /data Start
Start the database
./pg_clt-d. /data Start
Connect to database after startup:
Under the/usrl/local/pgsql/bin directory
Executes the./psql connection to the default Postgres data
You can then create a database, create a table, and so on.
Linux Environment Source Installation PostgreSQL