PostgreSQL

PostgreSQL (also known as Postgres) is a free and open-source relational database management system emphasizing extensibility and SQL compliance.

www.postgresql.org

Postgres DB backup script

To export a postgres database We use the pg_dump command: pg_dump -U postgres -v DATABASE -f FILENAME.sql And to import it back we use psql: psql -U postgres -W -d "FILENAME.sql" < FILENAME.sql Now that we know these commands We can easily create...

How to add uuid-ossp extension to PostgreSQL

PostgreSQL UUID (Universal Unique Identifier) is specified by RFC 4122 and has a 128-bit length.  Here We will cover two methods for enabling uuid-ossp extension to PostgreSQL: via CMD and PostgreSQL pgAdmin 4 GUI. Option 1. Enable uuid-ossp...

How to change PostgreSQL superuser password

Here is how to change postgresql superuser password on windows 10. From the terminal: net user postgres postgres From the UI: Right Click on My ComputerSelect ManageClick on local users and groupsThen usersRight-click on the usernameSelect Set...

⚠️ Restrict PostgreSQL users to only one session each

Recently we had a case where we needed to limit the PostgreSQL user activities to only a single connection per user, and in this article I’m going to share the experience with you. The connection limit is applied during the session connection...

Real-time 👀 viewing using pg_activity and pgAdmin

pg_activity is a great command-line tool for PostgreSQL server activity monitoring., and we are gonna show you how to install it and use it on a Linux machine. But what happens when someone that doesn’t have access to that Linux machine, wants...