Build and install PostgreSQL under Mac OSX

Source: Internet
Author: User
Tags postgresql psql

The original installation package was used, but the installation package creates the Postgre user. Look at the landing interface a bit uncomfortable, search for a half-day incredibly did not find how to compile the installation under OSX tutorial, and assume that the official document compiled installation method will let you crash, in line with the source code installation is similar to the idea, based on the previous experience in Linux actually passed, Be careful to install Commander line developers.


./configure

Make

sudo mkdir/u01

sudo mkdir-p/u01/pgdata

sudo chown-r gtlions:staff/u01/pgdata

sudo 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 9:05 morning??

0:00.00 Postgres:checkpointer Process
501 1625 1622 0 9:05 morning?? 0:00.02 Postgres:writer Process
501 1626 1622 0 9:05 morning?? 0:00.00 Postgres:wal Writer Process
501 1627 1622 0 9:05 morning??

0:00.00 postgres:autovacuum Launcher Process
501 1628 1622 0 9:05 morning?? 0:00.00 postgres:stats Collector Process
501 1622 1 0 9:05 am ttys001 0:00.02/usr/local/pgsql/bin/postgres
501 1636 1613 0 9:06 am ttys001 0:00.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 | Zh_cn. UTF-8 | =c/gtlions +
|          |             |             | | Gtlions=ctc/gtlions
template1 | gtlions | UTF8 | Zh_cn. UTF-8 | Zh_cn. UTF-8 | =c/gtlions +
|          |             |             | | Gtlions=ctc/gtlions
(3 rows)

gtlions:~ gtlions$ psql-ac "select version ();"
Select version ();
Version
--------------------------------------------------------------------------------------------------------------- --------------------
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-

Build and install PostgreSQL under Mac OSX

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.