PostgreSQL is a powerful relational database management system that is issued under BSD license [1]. PostgreSQL contains a number of advanced features, with good performance and good applicability. PostgreSQL binds a number of programming languages, such as C + +, Python, Java, PHP, http://www.aliyun.com/zixun/aggregation/13430.html ">ruby," etc. It can operate many things, from simple Web applications to huge databases with millions of of records.
Installation
You can use the command line to install PostgreSQL and enter:
sudo apt install PostgreSQL
Pgadmin III is a convenient PostgreSQL graphics client, it is suitable for beginners, you can enter the following command in the terminal to install:
sudo apt install pgadmin3
You can also install these packages through System-> System Management-> The new Riser Pack manager.
Start
sudo/etc/init.d/postgresql-8.4 start
sudo/etc/init.d/postgresql-8.4 stop
Set Password
Installation is complete, we need to change the Postgres user's password, otherwise we cannot use this database server. Run the Psql command as Postgres This system user, and enter the following in the terminal:
sudo su postgres-c psql template1
A new prompt will appear with the following two commands, replacing <***PASSWORD***> with the new password:
ALTER USER postgres with PASSWORD ' <***password***> ';
Creating a Database
To create the first database, we name it "MyDB" and enter:
sudo su postgres-c createdb mydb
Using the Pgadmin III graphical interface client
To understand what PostgreSQL can do, you first need to learn to use a graphical interface of the client, in the terminal input:
Pgadmin3
You are now stuck in the main interface of Pgadmin III, click on the "Add Database Connection" button (above left). Pop up a new dialog box, enter address 127.0.0.1, server description, default database "MyDB" and your password.
With this graphical interface, you can create new databases, tables, and other objects, query the database, add data, execute SQL statements, and so on. Connect with Pgadmin 3
Effect chart