SQL Tutorial – How to use pgAdmin for PostgreSQL.

Spread the love

What is pgAdmin used for?

pgAdmin is an administrative and management tool for PostgreSQL. It is a graphical interface (GUI) which helps you manage your PostgreSQL server, databases, import and export data and write SQL queries.

How to use pgAdmin ?

First open the pgAdmin from the start menu under PostgreSQL folder on windows. If you are on Mac then go to the Application folder and open it, also make sure that you have launched Postgres.app before opening the pgAdmin on Mac.

The left navigation pane shows the object browser. Here you can find the available servers, database, users and other objects. In the top we have menu bar and in the middle we have several options to manage and connect to the PostgreSQL database.

How to connect to the default PostgreSQL Database –

  1. First click on the arrow to the left of the servers and double click on PostgreSQL 14. In your system it might be also called localhost instead of PostgreSQL 14. So select that and enter the password that set during postgres installation.

2. Once the server is connected, you will see a window like this. Expand the Databases > postgres > Schemas > public > Tables. All the tables in your database will resides under the Tables on the left.

3. To write and execute SQL queries in pgAdmin we use the Query Tool. To access the query tool, right click on the postgres database and select Query Tool. You can write and execute sql queries from here. You can also open multiple tabs to connect and write queries for different database just as we did right now.

So far, we learned how to install PostgreSQL and pgAdmin, links are given below. How to use pgAdmin. In our next post we will learn How to create a postgres database using pgAdmin.

  1. How to install PostgreSQL and pgAdmin on Windows.
  2. How to install PostgreSQL and pgAdmin on Mac.
  3. Create a Database and a Table in PostgreSQL.

Rating: 1 out of 5.

Leave a Reply