Basic knowledge about PostgreSql download and installation in Linux

Source: Internet
Author: User

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

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.