REQUEST COMPLIMENTARY SQLS*PLUS LICENCE
Install PostgreSQL 12 on Windows 10 – for beginners
You will study in detail the process of installing PostgreSQL 12 on Windows 10.
In addition, we will also install and configure pgAdmin 4, which is a standard and free graphical tool for PostgreSQL DBMS management that we can use for writing SQL queries, developing procedures, functions, as well as for PostgreSQL administration.
What is PostgreSQL?
PostgreSQL is a free object-relational database management system (DBMS). PostgreSQL is implemented for many operating systems such as: BSD, Linux, macOS, Solaris and Windows.
PostgreSQL uses the PL/pgSQL language.
PL/pgSQL is a procedural extension of the SQL language, developed and used in PostgreSQL DBMS.
PL/pgSQL language is designed to create functions, triggers, it adds control structures to SQL language, and it helps us to perform complex calculations.
PostgreSQL is one of the most popular database management systems (TOP 5 popular database management systems).
At the time of writing, the most up-to-date version of PostgreSQL 12 is the one we will be installing.
System requirements for PostgreSQL 12 installation on Windows
PostgreSQL 12 can not be installed on all versions of Windows, in particular, the following versions are officially supported and only 64-bit:
|
As you can see, there’s no Windows 10 on the official list, but installation on this system goes smoothly, as does subsequent PostgreSQL functioning.
In addition, there are other requirements:
- Processor with at least 1 GHz;
- 2 gigabytes of RAM;
- At least 512 megabytes of free disk space (more for installing additional components is recommended);
- It is also recommended that all Windows operating system updates be installed.
Installing PostgreSQL 12 and pgAdmin 4 on Windows 10
So let’s move on to the installation process and look at all the steps that need to be followed in order to install PostgreSQL 12 and pgAdmin 4 on Windows 10.
Step 1 – Downloading the installer for Windows
As mentioned earlier, PostgreSQL is implemented for many platforms, but since we will be installing PostgreSQL on Windows, we need a Windows installer accordingly. You can of course download this distribution from the official PostgreSQL website, here is the download page – https://www.postgresql.org/download/windows/.
After going to the page you need to click on the link “Download the installer”, as a result you will be taken to the site of EnterpriseDB, which prepares graphical distributions of PostgreSQL for many platforms, including Windows, so you can immediately go to this site, here is the link to the download page https://www.enterprisedb.com/downloads/postgres-postgresql-downloads.
Here you need to select the PostgreSQL version and platform, in our case choose PostgreSQL 12 and Windows x86-64.
As a result, you should download the file postgresql-12.2-2-windows-x64.exe with the size of about 191 Mbytes (version 12.2-2 is available at the time of writing).
Step 2 – Starting the PostgreSQL installer
Now in order to start the installation you need to run the downloaded file (PostgreSQL installation requires administrator rights).
After the launch, a welcome screen will open, click “Next”.
Step 3 – Specify the directory to install PostgreSQL 12
Next, if necessary, we can specify the path to the directory where we want to install PostgreSQL 12, but we can leave it by default. Click “Next”.
Step 4 – Choose components for installation
Then select the components that we need to install, to do this we leave the checkboxes for the components that we need, and be sure we need PostgreSQL Server and pgAdmin 4.
You can install the command line utilities and Stack Builder on your own, i.e. you can not install them. Press “Next.”
Step 5 – Specify a directory to store database files
On this step, we need to specify the directory where the database files will be located by default.
In the case of a test installation, for example, for training, you can leave it by default, but “combat” databases should always be stored in a separate location, so if you plan to use the PostgreSQL server for some other purposes, it is better to specify a separate disk.
Click “Next”.
Step 6 – Set a password for the postgres system user
Next we need to set a password for a postgres user – this is a PostgreSQL Server administrator with maximum rights.
We enter and confirm the password. Click “Next”.
Step 7 – Specify the port for your PostgreSQL instance
On this step, if necessary, we can change the port on which PostgreSQL Server will work, if you do not have such a need, then leave it by default.
Click “Next”.
Step 8 – Specify the encoding in the database
Then we can specify a specific data encoding in the database, for this purpose we need to select the desired Locale from the drop-down list.
However, you can also leave it by default by clicking “Next”.
Step 9 – Checking PostgreSQL installation parameters
Everything is ready for installation, at this step we check the parameters we entered earlier and if everything is correct, i.e. everything we entered, we press “Next”.
Step 10 – Start the installation process
Next you will see another additional window where we must click “Next” to start the PostgreSQL installation process on your computer.
The installation has begun, it will last literally one minute.
Step 11 – Finishing the installation
When the “Completing the PostgreSQL Setup Wizard” message window is displayed, the installation of PostgreSQL 12, pgAdmin 4 and other components will be completed.
Also in this window we will be offered to run Stack Builder to download and install additional components, if you do not need it, then uncheck “Lanch Stack Builder at exit?
Click “Finish”.
Run and configure pgAdmin 4
PostgreSQL 12 and pgAdmin 4 we have installed, now let’s start pgAdmin 4, connect to the server and configure the pgAdmin work environment.
To start pgAdmin 4, go to the start menu, find PostgreSQL 12 and pgAdmin 4 in it.
Connecting to the PostgreSQL 12 server
pgAdmin 4 has a web interface, so as a result you should run your browser and open the pgAdmin 4 application.
The first time you start pgAdmin 4, you will see a “Set Master Password” window, where we must set a “master password”, this may not be done, but if we save the user’s password (“Save password” checkbox), for example, so that every time you connect you do not need to enter it, it is strongly recommended to invent and specify an additional password here, it is done once.
Enter it and click “OK”.
To connect to the newly installed local PostgreSQL server in the server browser, click on “PostgreSQL 12”.
The “Connect to Server” window will start, where you need to enter the password of the postgres system user, i.e. this is the password that you invented when you installed PostgreSQL.
Enter the password, tick “Save Password” to save the password and each time you do not enter it (thanks to the “master password” functionality, all passwords saved in this way will be additionally encrypted).
Click on “OK”.
As a result you will connect to the local PostgreSQL 12 server and see all the objects that are located on this server.
Example of writing an SQL query in Query Tool
In order to make sure that our PostgreSQL server is running, let’s write a simple SELECT query that will show us the PostgreSQL server version.
To write SQL queries in pgAdmin 4, you can use Query Tool or Russian “Query”, you can run it using the icon on the panel or from the menu “Tools”.
After you open the Query Tool, write.
SELECT VERSION()
This query shows the PostgreSQL version. As you can see, everything works!
How to Install PostgreSQL 12 and pgAdmin 4 on Windows 10
MORE NEWS
PreambleNoSql is not a replacement for SQL databases but is a valid alternative for many situations where standard SQL is not the best approach for...
PreambleMongoDB Conditional operators specify a condition to which the value of the document field shall correspond.Comparison Query Operators $eq...
5 Database management trends impacting database administrationIn the realm of database management systems, moreover half (52%) of your competitors feel...
The data type is defined as the type of data that any column or variable can store in MS SQL Server. What is the data type? When you create any table or...
PreambleMS SQL Server is a client-server architecture. MS SQL Server process starts with the client application sending a query.SQL Server accepts,...
First the basics: what is the master/slave?One database server (“master”) responds and can do anything. A lot of other database servers store copies of all...
PreambleAtom Hopper (based on Apache Abdera) for those who may not know is an open-source project sponsored by Rackspace. Today we will figure out how to...
PreambleMongoDB recently introduced its new aggregation structure. This structure provides a simpler solution for calculating aggregated values rather...
FlexibilityOne of the most advertised features of MongoDB is its flexibility. Flexibility, however, is a double-edged sword. More flexibility means more...
PreambleSQLShell is a cross-platform command-line tool for SQL, similar to psql for PostgreSQL or MySQL command-line tool for MySQL.Why use it?If you...
PreambleWriting an application on top of the framework on top of the driver on top of the database is a bit like a game on the phone: you say “insert...
PreambleOracle Coherence is a distributed cache that is functionally comparable with Memcached. In addition to the basic function of the API cache, it...
PreambleIBM pureXML, a proprietary XML database built on a relational mechanism (designed for puns) that offers both relational ( SQL / XML ) and...
What is PostgreSQL array? In PostgreSQL we can define a column as an array of valid data types. The data type can be built-in, custom or enumerated....
PreambleIf you are a Linux sysadmin or developer, there comes a time when you need to manage an Oracle database that can work in your environment.In this...
PreambleStarting with Microsoft SQL Server 2008, by default, the group of local administrators is no longer added to SQL Server administrators during the...