Compile and install PostgreSQL and osxpostgresql in Mac OSX

Source: Internet
Author: User
Tags psql

Compile and install PostgreSQL and osxpostgresql in Mac OSX

Originally, the official installation package was used. However, the installation package will create postgre, which is a bit uncomfortable on the login interface. After searching for a long time, I did not find a tutorial on how to compile and install it under osx, in addition, compiling and installation methods based on official documents will surely cause you to crash. Based on the idea similar to source code installation, based on past experience in Linux, the installation methods have been successfully implemented, be sure to install commander line developers.


./Configure

Make

Sudo mkdir/u01

Sudo mkdir-p/u01/pgdata

Sudo chown-R gtlions: staff/u01/pgdata

Make install


Vi. bash_profile

Export PGDATA =/u01/pgdata

Export PG_HOME =/usr/local/pgsql

Export PGDATABASE = postgres

Export PATH =/usr/local/bin: $ PG_HOME/bin: $ PATH

Export LD_LIBRARY_PATH = $ PG_HOME/lib: $ LD_LIBRARY_PATH

Export DYLD_LIBRARY_PATH = $ PG_HOME/lib: $ DYLD_LIBRARY_PATH


Initdb/u01/pgdata-E utf8

Pg_ctl-l $ PGDATA/server. log start


Gtlions :~ Gtlions $ ps-ef | grep postgres
501 1624 1622 0 AM ?? 0: 00. 00 postgres: checkpointer process
501 1625 1622 0 AM ?? 0: 00. 02 postgres: writer process
501 1626 1622 0 AM ?? 0: 00. 00 postgres: wal writer process
501 1627 1622 0 AM ?? 0: 00. 00 postgres: autovacuum launcher process
501 1628 1622 0 AM ?? 0: 00. 00 s: stats collector process
501 1622 1 0 am ttys001. 02/usr/local/pgsql/bin/postgres
501 1636 1613 0 ttys001. 00 grep postgres
Gtlions :~ Gtlions $ psql-l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
----------- + --------- + ---------- + ------------- + ---------------------
Postgres | gtlions | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
Template0 | gtlions | UTF8 | zh_CN.UTF-8 | = c/gtlions +
| Gtlions = CTc/gtlions
Template1 | gtlions | UTF8 | zh_CN.UTF-8 | = c/gtlions +
| Gtlions = CTc/gtlions
(3 rows)

Gtlions :~ Gtlions $ psql-ac "select version ();"
Select version ();
Version
Certificate -----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 9.3.5 on x86_64-apple-darwin14.0.0, compiled by Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn), 64-bit
(1 row)

Gtlions :~ Gtlions $


-EOF-


How to install ipvs in mac system

Appears during installation
"The database cluster initialisation failed"
This is a problem.
Run
Sudo dscl. delete/users/postgres
Solution

Urgent! How can I install Windows 7 on a hard disk on mac osx?

It is best to engrave it ...... If this is not the case, use refit for installation. You only need to guide the installation program smoothly. This is not a 100% guarantee.
 

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.