How to download and install PostgreSql in Linux:
[Merge multiple objects to append]
[Root @ localhost ~] # Useradd S
[Root @ localhost ~] # Passwd ipvs
【PostgreSQLPlease refer to the following link for more information]
[Root @ localhost ~] # Cd/usr/local/src
[Root @ localhost ~] # Wget ftp://ftp.postgresql.org/pub/binary/v8.0.15/linux/rpms/RedHat/rhel3.0/postgresql-server-8.0.15-1PGDG.i386.rpm
[Root @ localhost ~] # Wget ftp://ftp.postgresql.org/pub/binary/v8.0.15/linux/rpms/redhat/rhel3.0/postgresql-devel-8.0.15-1PGDG.i386.rpm
[Root @ localhost ~] # Wget ftp://ftp.postgresql.org/pub/binary/v8.0.15/linux/rpms/redhat/rhel3.0/postgresql-libs-8.0.15-1PGDG.i386.rpm
[Root @ localhost ~] # Wget ftp://ftp.postgresql.org/pub/binary/v8.0.15/linux/rpms/redhat/rhel3.0/postgresql-8.0.15-1PGDG.i386.rpm
【PostgreSQL has been released]
[Root @ localhost ~] # Rpm-ivh postgresql-* 8.0.15-1PGDG. i386.rpm
【Starting from PostgreSQL]
[Root @ localhost ~] #/Etc/rc. d/init. d/postgresql start
【PostgreSQL automatic configuration]
[Root @ localhost ~] # Chkconfig postgresql on
【PostgreSQLAutomatic Start settingConfirm]
[Root @ localhost ~] # Chkconfig -- list postgresql
Postgresql 0: off 1: off 2: on 3: on 4: on 5: on 6: offZookeeper has been released 2 ~ 5. Confirm on Login
[Postgres ユーになる]
[Root @Localhost~] # Su-postgres
[PostgreSQL uses CentOS when adding additional tags (when they are successfully accessed )]
-Bash-2.05b $ createuser-AdPE centos
CREATE USER
[Compile into tables using test results]
-Bash-2.05b $ createdb -- encoding EUC_JP test
CREATE DATABASE
[Confirm the authentication using testdb validation]
-Bash-2.05b $ psql-l
List of databases
Name | Owner | Encoding
----------- + -----------
Template0 | S | SQL _ASCII
Template1 | S | SQL _ASCII
Test | centos | EUC_JP
(3 rows)
Psql startup]
Bash-2.05b $ psql test
[Merge into tables into test results]
-Bash-2.05b $ create table test (num int, name varchar (50 ));
CREATE TABLE
Test => \ d test has been passed into validation test
Table "public. test"
Column | Type | Modifiers
-------- + --------------------- + -----------
Num | integer |
Name | character varying (50) |
[Login Login]
Test => insert into test values (1, 'yamada Taro ')
INSERT
[Notes]
Test => select * from test;
Num | name
----- + -----------
1 | Yamada Taro
(1 row)
[Distinct]
Test => drop table test;
DROP TABLE
[Psql stopped successfully stopped]
Test => \ q
[Distinct]
-Bash-2.05b $ dropdb test
DROP DATABASE
-Bash-2.05b $ exit
[PostgreSQL zookeeper cutting]
[Root @ linux ~] # Su-postgres
-Bash-2. 05b$ Dropuser centos
DROP USER
-Bash-2. 05b$ Exit