PostgreSQL 9.6.1 소스 코드 설치
4717 단어 SQL소스 코드PostgrePostgreSQL
Requirements softwares
1.GNU make version 3.80 or newer is required
[root@rhel7 ~]# make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
2.You need an ISO/ANSI C compiler (at least C89-compliant). Recent versions of GCC are recommended
[root@rhel7 ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
3. tar is required to unpack the source distribution, in addition to either gzip or bzip2.
4.The GNU Readline library is used by default.
readline
readline-devel
libedit
Optional
perl 5.8 or later
python
Kerberos
OpenSSL
OpenLDAP
and/or PAM
Flex 2.5.31 or later
Bison 1.875 or later
useradd pguser
su - pguser
tar -zxvf postgresql-9.6.1.tar.gz
Install
cd postgresql-9.6.1
./configure
기본 설치 디 렉 터 리 / usr / local / pgsql, -- prefix = path 를 사용 하여 수정 할 수 있 습 니 다.. / configure -- help
make
The last line displayed should be: All of PostgreSQL successfully made. Ready to install.
su (루트 설치 사용)
make install
PostgreSQL installation complete.
Set the environment variables for pguser
mkdir / usr / local / pgsql / data \ # PostgreSQL 데이터 저장 디 렉 터 리
chown pguser:pguser /usr/local/pgsql/data
export LD_LIBRARY_PATH=/usr/local/pgsql/lib
export PG_HOME=/usr/local/pgsql
export PATH=$PG_HOME/bin/:$PATH
export PGDATA=/usr/local/pgsql/data
Initilize the DBServer
(pguser 사용)
[pguser@rhel7 ~]$ initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "pguser".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /usr/local/pgsql/data -l logfile start
Start the DBServer
[pguser@rhel7 ~]$ postgres -D /usr/local/pgsql/data >logfile 2>&1 &
[1] 13799
[pguser@rhel7 ~]$ ps -ef |grep postgre
pguser 13799 4377 0 12:37 pts/0 00:00:00 postgres -D /usr/local/pgsql/data
pguser 13801 13799 0 12:37 ? 00:00:00 postgres: checkpointer process
pguser 13802 13799 0 12:37 ? 00:00:00 postgres: writer process
pguser 13803 13799 0 12:37 ? 00:00:00 postgres: wal writer process
pguser 13804 13799 0 12:37 ? 00:00:00 postgres: autovacuum launcher process
pguser 13805 13799 0 12:37 ? 00:00:00 postgres: stats collector process
pguser 13807 4377 0 12:37 pts/0 00:00:00 grep --color=auto postgre
연결 테스트
[pguser@rhel7 ~]$ psql --list
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+--------+----------+-------------+-------------+-------------------
postgres | pguser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | pguser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/pguser +
| | | | | pguser=CTc/pguser
template1 | pguser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/pguser +
| | | | | pguser=CTc/pguser
(3 rows)
[pguser@rhel7 ~]$ psql postgres
psql (9.6.1)
Type "help" for help.
postgres=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
(1 row)
postgres=# select current_date;
date
------------
2016-12-01
(1 row)
postgres=# \q
공식 문서:https://www.postgresql.org/docs/9.6/static/installation.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Redash를 사용할 때 몰랐던 SQL을 쓰는 법을 배웠습니다.최근 redash에서 sql을 쓸 기회가 많고, 이런 쓰는 방법이 있었는지와 sql에 대해 공부를 다시하고 있기 때문에 배운 것을 여기에 씁니다. Redash란? 월별로 데이터를 표시하고 싶습니다 주별로 데이터를 표...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.