PostgreSQL 9.1.2 source code compilation

Source: Internet
Author: User
Tags getting started with php

Just getting started with php, and then start compiling the environment, starting with PostgreSQL...

-----------------------------------------------------------

| System | CentOS 5.7.

-----------------------------------------------------------

If you encounter the dependency issue for compiling postgresql, please post it in a text box.

Yum-y install readline-devel

Refer:

PostgreSQL Download PageHttp://www.postgresql.org/ftp/source/

# Mkdir/usr/local/src/postgresql&&Cd/usr/local/src/postgresql

#Wget http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.gz

Extract

#Tar-zxvf postgresql-9.1.2.tar.gz

# Su--c "useradd-M postgres"

#Chown-R postgres: postgres postgresql-9.1.2


Configure Compilation
#./Configure -- help

#./Configure -- prefix =/opt/pgsql-- Sysconfdir =/opt/pgsql/etc

# Mkdir/Opt/pgsql/Data

# Chown postgres: postgres/opt/pgsql/data

Initialization

# Su ipvs

Bash-3.2 $/opt/pgsql/bin/initdb-D/opt/pgsql/data

[Plain]
  1. The files belonging to this database system will be owned by user "stored s ".
  2. This user must also own the server process.
  3. The database cluster will be initialized with locale en_US.UTF-8.
  4. The default database encoding has accordingly been set to UTF8.
  5. The default text search configuration will be set to "english ".
  6. Fixing permissions on existing directory/opt/pgsql/data... OK
  7. Creating subdirectories... OK
  8. Selecting default max_connections... 100
  9. Selecting default shared_buffers... 32 MB
  10. Creating configuration files... OK
  11. Creating template1 database in/opt/pgsql/data/base/1... OK
  12. Initializing pg_authid... OK
  13. Initializing dependencies... OK
  14. Creating system views... OK
  15. Loading system objects 'descriptions... OK
  16. Creating collations... OK
  17. Creating conversions... OK
  18. Creating dictionaries... OK
  19. Setting privileges on built-in objects... OK
  20. Creating information schema... OK
  21. Loading PL/pgSQL server-side language... OK
  22. Vacuuming database template1... OK
  23. Copying template1 to template0... OK
  24. Copying template1 to copying s... OK
  25. WARNING: enabling "trust" authentication for local connections
  26. You can change this by editing pg_hba.conf or using the-A option
  27. Next time you run initdb.
  28. Success. You can now start the database server using:
  29. /Opt/pgsql/bin/postgres-D/opt/pgsql/data
  30. Or
  31. /Opt/pgsql/bin/pg_ctl-D/opt/pgsql/data-l logfile start

Add Environment Variables

# Vi/etc/profile

PATH =/opt/pgsql/bin: $ PATH

Export PATH

# Source/etc/profile

Start:

# Mkdir/opt/pgsql/logs/

# Chown postgres: postgres/opt/pgsql/logs/

# Su ipvs

Bash-3.2 $/opt/pgsql/bin/pg_ctl-D/opt/pgsql/data-l/opt/pgsql/logs/pgsql. log start

Set the startup script:

#Su-c"Cp/usr/local/src/postgresql/postgresql-9.1.2/contrib/start-scripts/linux/etc/rc. d/init. d/postgresql-9.1.2"

#Su-c "chmod a + x/etc/rc. d/init. d/postgresql-9.1.2"

#Vi/etc/rc. d/init. d/postgresql-9.1.2

  • 1
  • 2
  • 3
  • Next Page

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.