WEBVTT

00:00.630 --> 00:06.420
The final piece of your setup puzzle is to get familiar with Pgadmin and administration and management

00:06.420 --> 00:08.410
tool for PostgreSQL.

00:08.430 --> 00:12.450
So the Pgadmin software is free, but don't underestimate its performance, right?

00:12.450 --> 00:19.310
So it's a full featured tool as a powerful as pie tool, such as Microsoft SQL Server Management Studio.

00:19.320 --> 00:24.960
So with Pgadmin, you get a graphical interface where you can configure multiple aspects of your Postgres

00:24.960 --> 00:27.270
SQL Server and databases.

00:27.270 --> 00:34.530
And most appropriately, for this course, you will use a SQL query tool for writing, running and saving

00:34.530 --> 00:35.280
queries.

00:35.430 --> 00:42.060
So now let's run the assuming you follow the installation steps for your operational system earlier

00:42.060 --> 00:43.520
in this section.

00:43.530 --> 00:51.570
So here's how you launch the Pgadmin So you can also go to start menu, find the PostgreSQL folder here.

00:52.140 --> 00:52.950
Let's actually.

00:53.810 --> 00:54.200
Here.

00:54.200 --> 01:00.710
You can also go to the start menu, uh, find the PostgreSQL folder here, as you can see here.

01:00.710 --> 01:06.200
And we have several applications here, which is one of them is Pgadmin and SQL Shell, which we will

01:06.200 --> 01:07.580
use all of this here.

01:07.610 --> 01:14.720
You can also use the application stack builder to download and install new extensions and so on.

01:14.720 --> 01:18.460
So let's click on the Pgadmin here and that's it.

01:18.470 --> 01:25.940
Now after you should see the Pgadmin splash screen followed by the application opening.

01:26.180 --> 01:32.390
So if it's your first time launching Pgadmin, you will also receive a prompt to set a master password,

01:32.600 --> 01:34.070
which you will see here.

01:38.310 --> 01:40.350
Let me get my pen.

01:46.970 --> 01:48.850
So PG admin is starting here.

01:55.040 --> 01:58.790
Might take some time, depending on your computer's performance.

02:00.050 --> 02:01.850
Let's start a write up.

02:04.540 --> 02:08.770
We also have pain here, which I will draw things on the screen.

02:19.510 --> 02:22.600
If there's a problem with starting, you know, it's starting.

02:22.600 --> 02:22.810
Yes.

02:22.810 --> 02:29.260
You can see there's a dialogue that you can read and see the status of our program.

02:32.570 --> 02:35.300
The Pgadmin four is started, as you can see here.

02:40.200 --> 02:40.800
That's it.

02:40.950 --> 02:43.940
So that's that's the password screen that I talked about.

02:43.950 --> 02:46.410
So the you will enter the password here.

02:46.410 --> 02:48.840
In this case, I already set my password.

02:48.840 --> 02:49.650
In this case.

02:49.650 --> 02:51.690
My password is one, two, three.

02:51.690 --> 02:54.120
And here after that click on.

02:54.120 --> 02:59.430
Okay, you can also reset master password from here to remove all the saved passwords will remove established

02:59.430 --> 03:02.580
connections to the server and you may need to reconnect again.

03:02.580 --> 03:03.270
Yes.

03:04.150 --> 03:05.560
Here and now.

03:05.560 --> 03:07.300
This is the screen you will see.

03:07.300 --> 03:09.730
And here I will enter my password again.

03:10.090 --> 03:10.960
This is a new password.

03:10.960 --> 03:12.250
And here, that's it.

03:12.460 --> 03:14.740
This is our pgadmin.

03:14.740 --> 03:22.270
So here on Mac on macOS, when you launch the Pgadmin the first time the dialog might appear that displays

03:22.270 --> 03:28.900
the Pgadmin for that application can't open because it's from an unidentified developer.

03:28.900 --> 03:35.650
So now you should have to right click on the icon and click open and the next dialog should give you

03:35.650 --> 03:38.140
the option to open the application going forward.

03:38.140 --> 03:41.440
Your Mac will remember your granting this permission.

03:42.040 --> 03:45.280
So this is only applies if you are using Mac in Linux.

03:45.280 --> 03:49.360
You will and in Windows you will open this program without any problems.

03:49.360 --> 03:53.140
So the Pgadmin layout includes a left vertical pane here.

03:53.470 --> 03:56.830
This is a left vertical pane here.

03:56.950 --> 03:58.840
This is a left vertical pane.

03:59.630 --> 04:05.030
Uh, that displays an object browser where you can find available servers here, as you can see here.

04:06.070 --> 04:09.280
And the databases, users and other objects.

04:09.310 --> 04:17.410
Across the top of the screen is a collection of various it's a collection of menu items and below these

04:17.410 --> 04:18.280
are the tabs.

04:18.280 --> 04:20.410
Here are the tabs.

04:21.290 --> 04:25.000
That displays various aspects of database objects and performance.

04:25.010 --> 04:27.910
So here now let's connect to our database.

04:27.920 --> 04:33.830
So PostgreSQL is a database management system, which means it's a software that allows you to define,

04:33.830 --> 04:35.630
manage and query databases.

04:35.630 --> 04:41.870
So when you install PostgreSQL, it created a database server, an instance of the application running

04:41.870 --> 04:42.590
on your computer.

04:43.310 --> 04:46.640
So that includes a default database called.

04:47.560 --> 04:48.670
Postgres here.

04:49.440 --> 04:54.990
A database is a collection of objects that includes tables, functions and much more.

04:55.320 --> 04:58.980
So this is where your actual data will lie here.

04:58.980 --> 05:04.950
So we use the SQL language as well as Pgadmin to manage objects and data stored in the database.

05:05.340 --> 05:11.970
So in next lectures you will create your own databases on your PostgreSQL server to organize your work.

05:11.970 --> 05:18.330
For now, let's connect to Default Postgres database to explore pgadmin that we created.

05:18.420 --> 05:24.660
Remember, we created this database when we started and installed some extensions and we also gave the

05:24.660 --> 05:27.090
passwords for this and you will use that password.

05:27.100 --> 05:31.770
In this case, my password is one, two, three here and click on okay.

05:32.070 --> 05:33.420
And that's it.

05:33.780 --> 05:39.330
So in the object browser, click on the downward pointing arrow to the left of the server node to show

05:39.330 --> 05:40.590
the default server.

05:40.590 --> 05:46.500
And depending on your operating system, the default server name could be localhost or PostgreSQL where

05:46.500 --> 05:50.710
you and the postgres SQL X here.

05:50.860 --> 05:52.420
In this case it's 15.

05:52.450 --> 05:54.220
Then this is the version number.

05:54.810 --> 05:55.560
So.

05:56.410 --> 06:00.670
Now expand the databases and then expand the default database PostgreSQL.

06:00.700 --> 06:07.000
Here, as you can see here, we have users table spaces, login and group roles.

06:08.310 --> 06:09.270
And that's it.

06:09.740 --> 06:10.310
So.

06:12.450 --> 06:17.230
So if Pgadmin doesn't show a default under servers, you will need to add it.

06:17.280 --> 06:19.050
Right click servers here.

06:20.100 --> 06:20.610
Read.

06:21.980 --> 06:23.030
And server group.

06:23.390 --> 06:25.520
And here we will name it something.

06:26.300 --> 06:27.560
In this case, it's my name.

06:27.590 --> 06:29.510
Typhoon and click on Save.

06:33.030 --> 06:33.270
Here.

06:33.270 --> 06:38.280
As you can see at the bottom, we opened some new databases, which has nothing in it.

06:39.200 --> 06:39.800
So.

06:40.130 --> 06:46.730
And after that you will add a create server group, register server and so on.

06:46.820 --> 06:49.040
So now.

06:50.170 --> 06:50.740
The.

06:50.890 --> 06:52.600
Let's explore the query.

06:52.810 --> 06:53.320
Right.

06:53.320 --> 06:54.310
So.

06:55.270 --> 07:00.660
The application includes a query tool which where you write and execute the code.

07:00.690 --> 07:09.660
So to open the query query tool in the object browser first, you click once on any database to highlight

07:09.660 --> 07:10.710
it here.

07:12.290 --> 07:13.690
This case is Postgres.

07:15.020 --> 07:15.470
That's it.

07:16.300 --> 07:19.230
And then you will select the tools.

07:19.240 --> 07:23.140
And here you will also select the query tool.

07:23.140 --> 07:25.530
So first you need to click on some database.

07:25.540 --> 07:28.300
In this case, it's Postgres here.

07:29.160 --> 07:29.910
That's it.

07:30.940 --> 07:33.580
Now after clicking postgres just once.

07:33.580 --> 07:37.000
And after that you will come to Tools and Query tool.

07:37.030 --> 07:38.020
That's it.

07:38.350 --> 07:39.970
So you will see.

07:41.040 --> 07:42.180
Three panes here.

07:42.450 --> 07:44.100
Separated by here.

07:44.100 --> 07:45.210
One, two, three.

07:45.570 --> 07:48.210
So this three panes.

07:50.210 --> 07:55.190
And you can also open the multiple tabs to connect and write queries for different databases or just

07:55.190 --> 07:57.560
organize your code the way you would like.

07:57.590 --> 08:02.240
So to open another type tab, click on database and the object browser.

08:02.540 --> 08:06.590
Here, as you can see, we have tab right now here we can also open this.

08:13.590 --> 08:14.010
Tools.

08:14.010 --> 08:18.450
We can also use the SQL tool, which you will see and we will use later.

08:18.450 --> 08:21.990
And here, as you can see here, this works like a browser here.

08:21.990 --> 08:23.640
We can navigate through that.

08:24.940 --> 08:28.570
So now let's enter the code into query editor.

08:28.570 --> 08:31.690
So here now we will.

08:32.850 --> 08:37.350
We will download the lecture extension that I uploaded here in this lecture.

08:37.350 --> 08:41.190
You can also find this in the Udemy downloadable section of this lecture.

08:41.250 --> 08:43.740
Now I will come right out here.

08:48.430 --> 08:53.740
So here we will use and let's actually use the basic statement here.

08:53.740 --> 09:00.280
So to execute this statement, highlight the line width here, select and then click execute.

09:01.240 --> 09:07.900
As you can see, we were successfully, successfully run and it showed us nothing.

09:08.140 --> 09:09.010
So.

09:09.970 --> 09:10.330
Here.

09:10.330 --> 09:11.530
This is the play button.

09:11.860 --> 09:12.760
Execute here.

09:12.760 --> 09:16.060
You can also use the F5 to execute.

09:16.070 --> 09:17.800
This is a shortcut for execution.

09:18.040 --> 09:19.120
And yeah.

09:20.580 --> 09:28.590
And if you write the select version like that, you will you you will see the version of our.

09:29.790 --> 09:31.180
For SQL Server.

09:31.190 --> 09:38.690
As you can see here, Postgres 15.2 compiled by Visual C plus plus built by 19 1464 bit.

09:38.930 --> 09:42.440
So you will learn you will learn much more about queries later in this course.

09:42.440 --> 09:49.310
But for now, all you need to know is that the query uses a PostgreSQL specific function called version

09:49.640 --> 09:52.070
to retrieve the version information for the server.

09:52.070 --> 09:59.720
In my case, the output proves that I'm running in 15.2 version and it provides additional specifics

09:59.720 --> 10:01.490
on the build of the software.

10:02.300 --> 10:03.110
Her here.

10:03.350 --> 10:08.420
Now, we can also customize the which we will do later in this section.

10:08.420 --> 10:09.590
So see you later.
