PostgreSQL (initially called Postgres) was created by a computer science professor Michael Stonebraker and his team. Today it has become one of the popular open-source databases.
PostgreSQL is an enterprise-class open source database management system. It supports both SQL for relational and JSON for non-relational queries. It is backed by an experienced community of developers who have made tremendous contribution to make it highly reliable DBMS system.
PostgreSQL is a general purpose and object-relational database management system, supports advanced data types and advance performance optimization, features only available in the expensive commercial database, like Oracle and SQL Server.
what is meant by object relational database
An Object relational model is a combination of a Object oriented database model and a Relational database model. So, it supports objects, classes, inheritance etc. just like Object Oriented models and has a support of data types, tabular structures etc. like Relational data model.
Advantages of Object Relational Model
The advantages of the Object Relational model are :
The Object Relational data model allows its user to inherit objects, tables etc. so that they can extend their functionality. Inherited objects contains new attributes as well as the attributes that were inherited.
Complex Data Types
Complex data types can be formed using existing data types. This is useful in Object relational data model as complex data types allow better manipulation of the data.
The functionality of the system can be extended in Object relational data model. This can be achieved using complex data types as well as advanced concepts of object oriented model such as inheritance.
Disadvantages of Object Relational model
The object relational data model can get quite complicated and difficult to handle at times as it is a combination of the Object oriented data model and Relational data model and utilizes the functionalities of both of them.
Features of PostgreSQL
- It runs on all major as like Linux, Unix and Windows.
- It supports text, images, sound, videos and include interfaces for many languages like – C, C++, Java etc.
- It supports a lot of features of sql like – complex sql queries, foreign key, triggers, views, transactions and concurrency.
- You can install several extensions to add additional functionalities to postgres.
How to use PostgreSQL
To install the postgreSQL installer, visit the below link:
This page will open when you click on the above link. For download just click on the “Download the installer” it will download the postgres installer and then install it.
When you install postgres it will give the database, but we also need a UI using which you can use it that’s where we need to install one more software named pgAdmin. The pgAdmin is a postgres tool. So, just download it, from the below link.
Let’s install the postgres installer.
Now, it will ask you for the password for the postgres database, it’s important because you’re a super-user. So, please remember the your password for postgres. The password I will set for this machine is “123456“.
Now, This is the port number you have to remember for different services we have different port numbers and that to for MySQL we have different port number 3306 for MySQL but for Postgres we have port number 5432.
Now, Sit relax it will take some time to complete.
Postgres is successfully installed in your machine.
Now, If you want to access it you need one more software to install which we have downloaded i.e. pgAdmin.
Then after, it will launch pgAdmin page on your browser for you.
When it will open, it will asks for the postgres password which you have configured when you install postgres installer. We don’t have a good UI tool it’s open in the browser.
Now, on the left hand side, you see, you have an option of servers. You can see we have some databases available here so by default, it having only one database we can use this existing one or we can create our own database.
In this you might be having some schemas (tables) by default we don’t have any table as of now.
Let’s create a new database, just by clicking on the Databases section.
The database “College” is created successfully, in that we have no tables so far. Let’s create a table in ‘College’ database.
If you want to perform create, insert, delete command manually, you can follow the following steps:
- In your pgAdmin toolbar, click on Tools
- In that select “Query Tool” it will open an editor.
The table “student” created successfully, to run the query press F5.
Let’s insert some values in the “student” table.
We successfully inserted 4 values in our ‘student‘ table. In the table section, on the left side, we can see the student table.
Let’s fetch all the data from the ‘student‘ table.
Now, you can fire end number of query you want.
Hope this helps.
Keep learning and Smiling.. 😊