Compile postgresql8.2.1 with the source code in ubuntu
Source: Internet
Author: User
In Ubuntu, you only need the sudoapt-getinstall *** software name, you can install the software you need To the system. However, if you have to install the latest software package, or if it is necessary to install the configuration separately to achieve the application optimization, you can install the source code. first, we need to install sudoapt-getinstalllibreadline-dev in the library file required by postgresql8.2.1 under Ubuntu. Generally, we only need the sudo apt-get install *** software name, you can install the software you need to the system.
However, if you have to install the latest software package
Or it is necessary to install the configuration separately to optimize the application.
You have made a good choice to install the source code.
First, install the library file required by postgresql8.2.1.
Sudo apt-get install libreadline-dev
The next step is to compile postgresql.
$ Tar zxvf postgresql-8.2.1.tar.gz
$ Cd postgresql
$ Sudo./configure -- perfix =/usr/local/pgsql
$ Make
$ Sudo make install
In this way, we have installed marshal in ubuntu. Next we will start to configure postgreql.
Sudo adduser postgres
Sudo mkdir/usr/local/pgsql/data
Sudo chown postgres/usr/local/pgsql/data
Sudo-u postgres sh
$/Usr/local/pgsql/bin/initdb-D/usr/local/pgsql/data
$/Usr/local/pgsql/bin/postmaster-D/usr/local/pgsql/data> logfile 2> & 1 &
$/Usr/local/pgsql/bin/createdb test
/Usr/local/pgsql/bin/psql test
Now we enter the test table created by postgresql.
We can use it later.
/Usr/local/pgsql/bin/postmaster-D/usr/local/pgsql/data> logfile 2> & 1 &
To start postgresql
If You Want To Enable Automatic startup, I will directly modify the Automatic startup file installed in apt.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service