0% found this document useful (0 votes)
58 views

Postgresql - SQL Shell - PSQL

This document discusses opening the PostgreSQL SQL Shell (psql) to connect to a PostgreSQL database server and login. It explains how to select the server, database, port, and provide username and password credentials to log in to the command line interface of psql.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Postgresql - SQL Shell - PSQL

This document discusses opening the PostgreSQL SQL Shell (psql) to connect to a PostgreSQL database server and login. It explains how to select the server, database, port, and provide username and password credentials to log in to the command line interface of psql.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PostgreSQL – SQL Shell – psql

When you install PostgreSQL, you get SQL Shell (psql) installed.

When you click on this program, PostgreSQL SQL Shell or in short psql is opened as shown below.

You have to select the server on which the PostgreSQL is running. By default, localhost is selected. If
PostgreSQL server is running on a different machine, you can provide the server name here. Else, just click
enter button on the keyboard to go with default server: localhost.
Now, you need to select a database. During postgres installation, a database is created with the name
postgres. You can either go with this default database, or select one of the database you already created. We
have a database created already with the name mydb . We will select this database.

Now the port. By default, PostgreSQL server runs on the port 5432, unless you change it during installation. If
you changed the port number, you can provide the same here.
Provide the username. We will go with the default user postgres.

Type in the password for the user and click enter. If the login credentials are correct, you will logged into the
command line interface of PostgreSQL as shown below.
Summary
In this tutorial, we learned how to open PostgreSQL SQL Shell (psql), connect to a PostgreSQL server and
login to a database with a username and password.

PostgreSQL

⊩ PostgreSQL Tutorial

⊩ PostgreSQL - Install

⊩ PostgreSQL GUI

⊩ PostgreSQL - psql Shell - Commands

⊩ PostgreSQL - Create Database

⊩ PostgreSQL - Select Database

⊩ PostgreSQL - List Databases

⊩ PostgreSQL - Drop Database

⊩ PostgreSQL - Create Table

⊩ PostgreSQL - Describe Table

⊩ PostgreSQL - SHOW Tables

⊩ PostgreSQL - Drop Table

⊩ PostgreSQL - INSERT INTO Table

⊩ PostgreSQL - SELECT FROM Table

⊩ PostgreSQL - WHERE

⊩ PostgreSQL - LIKE

⊩ PostgreSQL - JOIN

⊩ PostgreSQL - WITH

⊩ PostgreSQL - UPDATE

⊩ PostgreSQL - UPDATE FROM SELECT

⊩ PostgreSQL - ADD COLUMN

⊩ PostgreSQL - DELETE COLUMN

⊩ PostgreSQL - PRIMARY KEY

⊩ PostgreSQL - FOREIGN KEY

⊩ PostgreSQL - SELECT INTO

⊩ PostgreSQL - Current Date

⊩ PostgreSQL - LIMIT

⊩ PostgreSQL - HAVING

⊩ PostgreSQL - DISTICNT

You might also like