Install PostgreSQL on Windows

Download and Installation Set-Up

To use PostgreSQL in your machine, you need to install:

1. Postgres database server
2. A graphical tool to administer and manage the database PgAdmin is the most popular GUI tool for Postgres.
postgresql install on window pc Note: If you download and install the bundled installer that will take care of configuration settings. You could download and install the individual database server and graphical tool but coupling the setting between these components will be a challenge.

Following steps indicate how to download and install PostgreSQL in windows machine:
Step 1 :  Download PostgreSQL | TutorialandExample Step 2:
  • Click on the download the installer
Step 3:
  • Check the latest version of PostgreSQL for your operating system and click on a download
PostgreSQL Download and Installation | TutorialandExample When you click on download, the download begins. PostgreSQL Downloading | TutorialandExample Step 4:
  • Double click on the downloaded .exe file that will open the setup wizard, click on Next to proceed with an installation
install PostgreSQL Setup | TutorialandExample Step 5:
  • You can change the installation directory here if you want to
  • Click on Next
PostgreSQL Installation Directory | TutorialandExample Step 6:
  • Select the components you want to install
  • Click on Next
PostgreSQL Component want to Installation | TutorialandExample Step 7:
  • leave the default directory or change the directory in which you want to store data
  • Click on Next
PostgreSQL Data Directory | TutorialandExample Step 8:
  • Enter the superuser (Postgres) password
  • Click on Next
PostgreSQL setting Password | TutorialandExample Step 9:
  • Click on Next, don’t change the default port number
PostgreSQL Port | TutorialandExample Step 10:
  • Leave the default option as it is
  • Click on Next
PostgreSQL advance options | TutorialandExample Step 11:
  • This is the pre-installation summary
  • Click on Next
PostgreSQL Pre Installation Summery | tutorialandExample Step 12:
  • The set-up is now ready to install
  • Click on Next
PostgreSQL Ready to Installation | TutorialandExample Wait until set up installs entirely on your machine.... PostgreSQL wait Installation | TutorialandExample Step 13: You will see the stack builder stack after complete installation
  • Uncheck the stack builder option that will ask you for additional installation
  • Click on Finish
PostgreSQL Completing | TutorialandExample Step 14: To launch PostgreSQL, go to the START menu
  • Select PgAdmin 4
PostgreSQL Start Menu | TutorialandExample Step 15
  • You will see PgAdmin homepage
PostgreSQL Pgadmin Home Page | TutorialandExample Step 16:
  • Select Servers -> PostgreSQL (11)
  • Right click on it and select connect Server
PostgreSQL Connect Server | TutorialandExample Step 17:
  • Enter the password to connect with the server
  • Click on OK
PostgreSQL Connect Server Password | tutorialandExample Now you can interact with Postgres database in two ways
  1. Using PgAdmin, i.e. GUI tool
  2. SQL shell (psql) through command prompt
Step 18:
  • Open START menu
  • Click on SQL shell
PostgreSQL start | TutorialandExample Step 19:
  • Press Enter Key until prompt for the password
  • Enter the password
PostgreSQL aa | TutorialandExample Example: Let us see, an example of create table, inserting data into the table and display the same. Create table Query Syntax: Create table table_name (column_name1 data_type, column_name1 data_type, ……); Example: Create table EMP (emp_id int, emp_namevarchar(20), emp_salary int, dept varchar(10)); Insert into Query Syntax: Insert into table_name values (‘value1’, ‘value2’, …… ); Example: Insert into EMP values (101, ‘Rohit Sharma’, 25000, ‘IT’); Display table content Syntax: Select * from table_name; Example: Select * from EMP; PostgreSQL Example | TutorialandExample

Summary

  • It is open-source object-oriented DBMS
  • The source code is freely available
  • It is a community project
  • It is written in C language
  • There is no maximum limit on database sizes
Reference: https://www.guru99.com/introduction-postgresql.html



ADVERTISEMENT
ADVERTISEMENT