🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to PostgreSQL Notes
Topic #5

PostgreSQL pgAdmin 4


Connect to the Database

In the previous chapter we learned how to connect to the database using the SQL Shell (psql) application, which is a command-based application that allows us to interact with the PostgreSQL database.

There is another application that comes built-in with the PostgreSQL installation, the pgAdmin 4 application, which also offers to interact with the database, but in a more user-friendly way.

Let us take a look and see how it works.


Start pgAdmin4

You will find the pgAdmin4 application in the start menu under PostgreSQL:

image

Tip: If you cannot find it, try searching for "pgAdmin4" on your computer.

Once the program has started, you should see a window like the one below, choose a master password, Since this is a local database that will run only on my computer, I will once again choose the password 12345678:

image


pgAdmin4

Once you are inside the program, try to perform a simple SQL query.

To do that we have to navigate to the database.

Start by opening the [Servers] option in the menu on the left:

image


Connect to Server

Now you need to enter the password that you created when you installed PostgreSQL, my password is 12345678:

image


Find Database

Click on the [Database] option on in the menu on the left:

image


Open Query Tool

You should find a database named postgres, right-click it choose the "Query Tool":

image


Query Tool

In the Query Tool we can start executing SQL statements.

image


Write SQL Statements

Our database is empty, so we cannot query any tables yet, but we can check the version with this SQL statement:

SELECT version();

To insert SQL statements in the Query Tool, just write in the input box like this:

image


Execute SQL Statements

To execute a SQL statement, click the "Play" button above the input box:

image


Result

The SQL statement is executed, and you can see the result in the "Data Output" area:

image

Now we have learned two ways of connection to a database and execute SQL statements on it:

  • SQL Shell (psql)
  • pgAdmin 4

In the next chapters we will use the SQL Shell application to create tables and insert data into the database.

If you want to use the pgAdmin interface instead, you can run all the SQL statements there, you should get the same result.

Want to go beyond the notes?

Join CodingNow 2.0's PostgreSQL course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

PostgreSQL pgAdmin 4 – FAQs

Quick answers about learning PostgreSQL pgAdmin 4 in PostgreSQL.

This free note from CodingNow 2.0 explains PostgreSQL pgAdmin 4 in PostgreSQL — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every PostgreSQL topic on CodingNow 2.0, including PostgreSQL pgAdmin 4, is 100% free with no signup required.
With focused practice, most students grasp PostgreSQL pgAdmin 4 in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now