Ubuntu Compilation Install PostgreSQL

Source: Internet
Author: User
Tags log log postgresql

Busy with the source code compiled and installed PostgreSQL, encountered a lot of trouble, record a bit.

1: An error occurred while using the./configure configuration. Look at the information that is missing the relevant package. What Readline,zlip and so on.

My configuration is simple, just configure the path:./configure--prefix=/home/zhangsan/postgresql

According to the error message, it is not what package I have. Install via new software.

Do not know right, the last configuration error, also compiled successfully.

2: To create a Linux User: Postgres and the default user for the database.

Shell>adduser Postgres

3: Create the data and log two directories in the PostgreSQL installation directory, respectively, and store the database and logs.

To make sure that the owner of the PostgreSQL directory and the following directory is Postgres, modify

Shell>sudo Chown postgres:postgres/home/zhangsan/postgresql/

4: Switch to Postgres user and initialize database

Use the POSTGRESQL/BIN/INITDB command. Specify the data directory and the log directory when you use it

shell>initdb-d/home/zhangsan/postgresql/data-x/home/zhangsan/postgresql/log

5: An error occurred while starting the database service with PG_CTL.

found no such person directory, nor that file.

But I looked at it with ls , and found a file with the same name in the TMP directory, using the LN command to make a soft link.

Ln-s/tmp/.s.pgsql.5432

Also cancel the # comment in data/postgresql.conf


Could not open this file, switch to root on the open.

Then in the log log directory to build a log file Pglog.log, the file name is random.

Then start with the command pg_ctl. Specify data directory and log file at startup

pg_ctl-d/.../data-x/.../log/pglog.log

With an absolute path.

Switch to Postgres user, start with psql.

Ubuntu Compilation Install PostgreSQL

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.