top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

PostgreSQL –A step by step guide for installation-Connect to server using pgAdmin - Basic operations


Let’s understand what is PostgreSQL and pgAdmin, see how we can install it on windows, how to connect PostgreSQL database server using pgAdmin4 and how to do the basic operations in PostgreSQL.


What is PostgreSQL?


  • PostgreSQL(also known as Postgres) is an open-source relational database management system (RDBMS).

    A relational database is a type of database that uses a tabular structure to organize data into tables with

    rows and columns.

  • PostgreSQL is more efficient platform for managing large volumes of structured data.

  • PostgreSQL is widely used for building high-performance, data-driven applications.

  • Postgres is a SQL engine that stores data and read queries and returns information.


What is pgAdmin?


  • pgAdmin is a free and open source administration and development platform for managing PostgreSQL databases.

  • It provides a graphical user interface that allows users to interact with the database and perform various administrative task.

  • pgAdmin is available for multiple operating systems and is widely used as a primary tool for PostgreSQL database administration.

  • pgAdmin is a Graphical User Interface for connecting with PostgreSQL.


To work with PostgreSQL and PgAdmin we need to install it, right? So, let’s dig  into the installation process.


Steps to install PostgreSQL on Windows


  1. Go to the browser and search for PostgreSQL download.


2. Select PostgreSQL download as shown below.


3. Select windows as shown below.

 

4.       Click on Download the installer from the top as shown below.

5.       Select the latest version from top as shown below.

It will take a few minutes to complete the download.

6.       Click yes to the popup window.


7.       Double click the download to open.


8.       The setup window pops up then click on next.


9.        You can leave this default path as it is or can change to your desired location, then click on next.


10.  You can unselect stack Builder and click on next.

(You can later Install the Stack Builder additional addons when needed in the project)

 

11.  Then click on next without any change.

 

12.  Create your own password and click on next.


13.  Then click on next on the port window. 


14.  Then click on next.

 

15.  Then click on next.


16.    Click on next. The setup is now ready for PostgreSQL to get installed.

 

 

 

17.    Here you can unselect the option for Stack Builder and click on the finish button to complete the installation.


 

18. It will take few minutes to complete the installation


Once the installation is complete it’s time to add the path Environment Variables.


19. Adding the path environment variables


  • Let's, find the path of the bin directory of the PostgreSQL installation. Usually, it is set to the following:

    C:\Program Files\PostgreSQL\<version>\bin

    Version here indicates what type of version you installed for PostgreSQL

  • Go to the search option on the desktop. You can choose either Edit the Environment Variables for your account or System Environment variables to add the bin path. Let’s see how to do with System Environment Variables.

  • < Search for Edit the System Environment Variables  

  • < Click on Environment Variables

  •  < Select path under system variables

  •  < Click on Edit

  • < Click New in the Edit Environment Window

  • < Add the path from your system as shown.

  • C:\Program Files\PostgreSQL\16\bin

  • < Click OK to close the Environment Window

  • < Click OK to close the System Variables Window

You can follow the same steps for User Environment Variables.

 

Congratulations on completing the installation! But remember, there is a lot more to do.

 

Connect to PostgreSQL database server using PG Admin


Now let’s see step by step how to connect to PostgreSQL database server using PG Admin.


  1. Launch pgAdmin4 from the search menu of your system. After launching, your pgAdmin4 will look like this as shown below.


 

2. Create a server by right clicking the Servers and select Register > Server as shown below.


3. Enter the server’s name as Local, and click the Connection tab as shown below.


4. Enter the Host name as localhost and enter the password which you created for PostgreSQL installation and select save password and click the Save button as shown below.


5. Expand the server. PostgreSQL has a database named Postgres by default as shown below.

6. PgAdmin is all set. Now let’s work on queries, for that open the query tool by selecting the menu item Tool > Query Tool as shown below.


Now finally you can start writing and executing the queries with some basic operations.

Basic Operations in PostgreSQL with examples:


Let's get familiar with some basic operations and its use. Here are the some basic operations that we do in PostgreSQL like creating a database, creating a table, inserting data in the table, fetching data from the table,

updating and deleting data from the table with some examples.


1.       Creating a Database


 

2.       Creating a Table

 

 

3.       Inserting Data

 

 

4.       Querying Data

5.       Updating Data

6.       Deleting Data


That's it ! Now you are ready to work on  PostgreSQL queries by exploring more .............


Hope this blog helps you in installing, connecting and operating PostgreSQL.

 

Keep installing, keep exploring, keep learning!!

 

 

 

 

 

 

 

 

 

 

 

 

 

14 views0 comments

Comentarios

Obtuvo 0 de 5 estrellas.
Aún no hay calificaciones

Agrega una calificación
bottom of page