Skip to content
June 22, 2026
  • Linkedin
  • Twitter
  • Facebook
  • Youtube

Daily CyberSecurity

Zero-hour alerts. Unmatched analysis.

Primary Menu
  • Home
  • CVE Watchtower
  • Cyber Criminals
  • Data Leak
  • Linux
  • Malware
  • Vulnerability
  • Submit Press Release
  • Vulnerability Report
Light/Dark Button
  • Home
  • Technique
  • Installing Postgresql on Debian/Ubuntu
  • Technique

Installing Postgresql on Debian/Ubuntu

Do Son May 7, 2018 2 minutes read

PostgreSQL, often simply Postgres, is an object-relational database management system with an emphasis on extensibility and standards compliance.PostgreSQL is used by many applications. PostgreSQL is installed on Ubuntu/Debian with one command:

apt–get install postgresql

When installed, a postgres user with a local authentication of the Ident Authentication type is created.

We enter the database under the user postgres:

sudo –u postgres psql

Creating a Superuser with Password Authentication

Create a new user:
root – username;
MyPassword is the password.

 CREATE USER root WITH password ‘MyPassword’;

We give the rights of the superuser:

 ALTER USER root WITH SUPERUSER;

Exit from psql :

\q

Now you can connect to a user root with password authentication:
Since user root does not have its own database, we will connect to the postgres database :

 psql –h localhost –U root –d postgres –W

Parameters:
-h – server;
-U – username;
-d – database;
-W – use password authentication.

Creating a User and Database

Again, go into the management interface psql and create another user:
user – the username;

 CREATE USER user WITH password ‘MyPassword1’;

Create a database:
user_db – the name of the database;
MyPassword1 is the password.

CREATE DATABASE user_db;

give the user user rights to the user_db database :

 GRANT ALL ON DATABASE user_db TO user;

Exit from psql :

 \q

Now you can connect to the created database:

 psql -h localhost -U user -d user_db -W

Operations with tables

Create a users table with the login and password fields :

 CREATE TABLE users (login CHAR(64), password CHAR(64));

Delete table:

DROP TABLE users;

Useful commands in the psql interface :

Show users:

\du

Show databases:

\l

Show tables in the current database:

\dt

Show columns in the table:

 \d table_name

Show PostgreSQL version:

SELECT version();

Show the help of SQL statements:

\h

Show the help of psql commands:

 \?

Share this article:

Facebook Post LinkedIn Telegram
Tags: Installing Postgresql

Search

Translation

CVE WATCHTOWER
🚨

Receive alerts for vulnerabilities being exploited in the wild.

⚡

Get notified instantly when a Proof of Concept (PoC) exploit is published.

🔍

Access critical info on vulnerabilities even when marked as "RESERVED".

🧠

Insights powered by decades of expertise and global intelligence sources.

🎯

Customize alerts with up to 10 keywords for your specific tech stack.

📊

Export the raw CVE database for SIEM integration and reporting.

Upgrade Package

🔴 Live Critical Threats

  • CVE-2026-5366CVSS 9.9
    Prefect version 3.6.23 is vulnerable to remote code execution due to improper...
  • CVE-2024-58351CVSS 9.8
    Flowise before 2.1.4 allows configuration to be injected into the Chainflow during...
  • CVE-2022-50972CVSS 9.8
    WooCommerce 7.1.0 contains a remote code execution vulnerability that allows attackers to...
  • CVE-2019-25763CVSS 9.8
    WordPress Ultimate Addons for Beaver Builder 1.2.4.1 contains an authentication bypass vulnerability...
  • CVE-2026-11551CVSS 9.8
    The Branda plugin for WordPress is vulnerable to privilege escalation via account...
  • CVE-2026-56081CVSS 9.1
    Cap-go before 12.128.2 contains an authentication logic flaw that lets an attacker...
  • CVE-2026-56073CVSS 9.4
    Cap-go before 12.128.2 contains an authentication bypass vulnerability in OTP verification that...
  • CVE-2026-55447CVSS 9.6
    ### Summary All components based on `BaseFileComponent` are vulnerable to the following...
  • CVE-2026-48584CVSS 9.9
    Execution with unnecessary privileges in Azure Synapse allows an authorized attacker to...
  • CVE-2026-48582CVSS 9.6
    Missing authorization in Microsoft Exchange Online allows an authorized attacker to elevate...
Powered by CVE WATCHTOWER

Recent Zero-Day Vulnerabilities

  • GreatXML BitLocker Bypass: Public PoC Exploit Disclosed
  • Check Point VPN Vulnerability Exploited in the Wild with Ransomware Links
  • Weekly Threat Intelligence: June 1 to June 7, 2026
  • Cisco SD-WAN Vulnerability Exploited in the Wild with Root RCE Risks
  • Android Zero-Day Flaw Exploited in the Wild: June 2026 Patches Released
  • Exploited in the Wild: Critical OWA Spoofing Flaw (CVE-2026-42897) Hits On-Premises Exchange Servers
Our Websites
  • Penetration Testing Tools
  • The Daily Information Technology
  • Daily CyberSecurity

    • About SecurityOnline.info
    • Advertise with us
    • Announcement
    • Contact
    • Contributor Register
    • Login
    • About SecurityOnline.info
    • Advertise on SecurityOnline.info
    • Contact Us

    When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works

    • Disclaimer
    • Privacy Policy
    • DMCA NOTICE
    • Linkedin
    • Twitter
    • Facebook
    • Youtube
    © 2017 - 2026 Daily CyberSecurity. All Rights Reserved.