PostgreSQL installation experience

Today started to use their leisure time to learn PGSQL. Below I posted my initial installation experience.
1, encountered two errors:
  1), the configure: error: Library not found readline
  Solution:
  install libtermcap-devel-2.0.8-46.1.i386.rpm
  and readline-devel-5.1-1.1.i386.rpm
  installation process not to say.
  for inflate in -lz ... Checking NO
  2), the configure: error: Library zlib not found 
  the solution:
  install zlib-devel-1.2.3-3.i386.rpm
  then ./configurate;make;make install
  if to this further says that the installation was successful.
  Complete Installation the PostgreSQL.
 The PGSQL successful installation
2, a subsequent set
[the root @localhost pgSQL] # the make the dir / usr / local / pgSQL / Data
PostGRE ROOT does not seem to be operated. Only ordinary users.
[root @localhost pgsql]# adduser postgres
[root @localhost pgsql]# chown -R postgres /usr/local/pgsql/data/
初始化数据库:
[root @localhost pgsql]# su postgres
[postgres @localhost pgsql]$ ./bin/initdb -D /usr/local/pgsql/data/
The files belonging to this database system will be owned by user "postgres".
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.

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

The WARNING: Enabling "Trust" authentication for local Connections
by You CAN Change the this by the pg_hba.conf Editing at The -A or a using the Option at The
the Next Time you RUN initdb.

Success by You CAN now at The Database Server Start a using:.

    ./Bin/postgres -D / usr / local / pgSQL / the Data
or
    ./bin/pg_ctl -D / usr / local / pgSQL / the Data start the -l logfile

start with POSTGRES user pGSQL service process
/ usr / local / pgsql / bin / postgres -D / usr / local / pgsql / data> logfile 2 > & 1 &
actual operation
may be started so pGSQL service process
/ usr / local / pgsql / bin / pg_ctl -D / usr / local / pgsql / data -l / usr / local / pgsql / logfile start
made service to start automatically
[root @localhost start-scripts] # cp / usr / local / pgSQL / contrib / start-scripts / Linux /etc/init.d/pgsql
[root@localhost start-scripts]# chkconfig --add pgsql
[root@localhost start-scripts]# service pgsql status
pg_ctl: server is running (PID: 7019)
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
[root@localhost start-scripts]# export PATH=$PATH:/usr/local/pgsql/bin/

[postgres @localhost ~]$ createdb t_girl
CREATE DATABASE
[postgres @localhost ~]$ psql t_girl
Welcome to psql 8.2.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

t_girl=# select version();
                                              version                                               
----------------------------------------------------------------------------------------------------
 PostgreSQL 8.2.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
(1 row)
t_girl=# \q
[postgres @localhost ~]$ dropdb t_girl
DROP DATABASE
更多见:
[url]http://www.pgsqldb.org/pgsqldoc-8.1c/postmaster-start.html[/url]

This article comes from " God, let there or be square! " Blog, reproduced please contact the author!

Reproduced in: https: //my.oschina.net/u/585111/blog/219463

Guess you like

Origin blog.csdn.net/weixin_33739541/article/details/92008350