Introduction To PostgreSQL
Posted By : Hotam Singh | 08-Sep-2018
Hi Guys, In today's topic, we will be discussing PostgreSQL. We have mostly come across MySQL, Oracle, MongoDB. Today I am giving a brief introduction to PostgreSQL.
What is PostgreSQL?
PostgreSQL is an open source database i.e ORDBMS(Object relational database Management System). it had been developed at Berkeley engineering science Department, California(University of California). Postgres is offered beneath PostgreSQL license and free to use. you're free to use, modify and distribute PostgreSQL in any form.
PostgreSQL features highlights
1. User-defined types
2. Table inheritance
3. Sophisticated locking mechanism
4. Foreign key referential integrity
5. Views, rules, subquery
6. Nested transactions (savepoints)
7. Multi-version concurrency control (MVCC)
8. Asynchronous replication
What makes PostgreSQL stand out
* PostgreSQL is the initial database management system that implements multi-version concurrency control (MVCC) feature, even before Oracle. Earlier the MVCC feature is known as snapshot isolation in Oracle.
* User can define your own data types, index types, functional languages, etc.
* Adding a new optimizer(Custom Plugin).
* You will get huge support from community, an active community is available to help.
Who is using PostgreSQL
Many companies are using built in products and solutions using PostgreSQL. Some of the popular companies using PostgresQL are Apple, Fujitsu, Red Hat, Cisco, Juniper Network, etc.
Connect to database
To connect to postgres database server, run below command:
$ sudo -su postgres psql
If successfully connected, you will see like below image:
Check Postgres installed or not
View server version
$ SHOW server_version;
OR
To find the PostgresQL server version from the shell command, simply issue a
$ postgres -V
postgres (PostgreSQL) 10
If
$ locate bin/postgres
Now with the direct path to the listed
$ /usr/lib/postgresql/10/bin/postgres -V
Output:
postgres (PostgreSQL) 10.5 (Ubuntu 10.5-1.pgdg16.04+1)
Check client version
To check postgres client version, issue below command from the postgres-server shell:
$ SELECT VERSION();
Output looks like:
OR
To check client version, again simply pass the -V flag to the
$ psql -V
Similar if you cannot find the Postgres version – or have multiple installations of PostgreSQL on that machine – you can easily locate
$ locate bin/psql
Output looks like:
Now issue a direct call to the located
$ /usr/lib/postgresql/10/bin/psql -V
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Hotam Singh
Hotam has 1.5 years of experience in Node.JS. He has worked on Front End, JavaScript, Jquery, Backbone.JS, Database: MySQL, MongoDB. His hobbies are playing Sudoku/Puzzles and watching movies.