How to Install configure and connect to PostgreSQL on Amazon Linux EC2 instance

In this article, we will see How to Install configure and connect to PostgreSQL on Amazon Linux EC2 instance step by step.
Continue reading How to Install configure and connect to PostgreSQL on Amazon Linux EC2 instance

What is difference between pg_ctl and systemctl in PostgreSQL

In this article, we will see the difference between pg_ctl and systemctl in PostgreSQL.

Difference between pg_ctl and systemctl in PostgreSQL

Continue reading What is difference between pg_ctl and systemctl in PostgreSQL

How to install PostgreSQL on Linux Mint

In this article, we will see how to install PostgreSQL on Linux Mint step by step.

Install PostgreSQL on Linux Mint

Continue reading How to install PostgreSQL on Linux Mint

How to install PostgreSQL 15 on Fedora 37

In this article, we are going to see How to install PostgreSQL 15 on Fedora 37 step by step.

PostgreSQL 15 is latest version available at the time writing this article. PostgreSQL 15 adds features to simplify conflict management, including the ability to skip replaying a conflicting transaction and to automatically disable a subscription if an error is detected. This release also includes support for using two-phase commit (2PC) with logical replication.

Steps to install PostgreSQL 15 on Fedora:

1. We have to update the packages by running below command on Fedora.

sudo dnf update

2. Install the repository RPM:

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/F-37-x86_64/pgdg-fedora-repo-latest.noarch.rpm

How to install PostgreSQL 15 on Fedora 37

3. Install PostgreSQL 15 on Fedora by running below command:

sudo dnf install -y postgresql15-server

s[r2schools@fedora ~]$ sudo dnf install -y postgresql15-server PostgreSQL common RPMs for Fedora 37 - x86_64 79 B/s | 195 B 00:02 PostgreSQL common RPMs for Fedora 37 - x86_64 417 kB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL common RPMs for Fedora 37 - x86_64 34 kB/s | 236 kB 00:06 PostgreSQL 15 for Fedora 37 - x86_64 78 B/s | 195 B 00:02 PostgreSQL 15 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL 15 for Fedora 37 - x86_64 43 kB/s | 155 kB 00:03 PostgreSQL 14 for Fedora 37 - x86_64 63 B/s | 195 B 00:03 PostgreSQL 14 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL 14 for Fedora 37 - x86_64 46 kB/s | 172 kB 00:03 PostgreSQL 13 for Fedora 37 - x86_64 94 B/s | 195 B 00:02 PostgreSQL 13 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL 13 for Fedora 37 - x86_64 40 kB/s | 176 kB 00:04 PostgreSQL 12 for Fedora 37 - x86_64 97 B/s | 195 B 00:02 PostgreSQL 12 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL 12 for Fedora 37 - x86_64 44 kB/s | 165 kB 00:03 PostgreSQL 11 for Fedora 37 - x86_64 92 B/s | 195 B 00:02 PostgreSQL 11 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL 11 for Fedora 37 - x86_64 26 kB/s | 165 kB 00:06 PostgreSQL 10 for Fedora 37 - x86_64 111 B/s | 195 B 00:01 PostgreSQL 10 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG PostgreSQL 10 for Fedora 37 - x86_64 14 kB/s | 52 kB 00:03 Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: postgresql15-server x86_64 15.1-1PGDG.f37 pgdg15 6.1 M Installing dependencies: lz4 x86_64 1.9.3-5.fc37 fedora 58 k postgresql15 x86_64 15.1-1PGDG.f37 pgdg15 1.5 M postgresql15-libs x86_64 15.1-1PGDG.f37 pgdg15 295 k Transaction Summary ================================================================================ Install 4 Packages Total download size: 7.9 M Installed size: 34 M Downloading Packages: (1/4): lz4-1.9.3-5.fc37.x86_64.rpm 64 kB/s | 58 kB 00:00 (2/4): postgresql15-libs-15.1-1PGDG.f37.x86_64. 195 kB/s | 295 kB 00:01 (3/4): postgresql15-15.1-1PGDG.f37.x86_64.rpm 792 kB/s | 1.5 MB 00:01 (4/4): postgresql15-server-15.1-1PGDG.f37.x86_6 2.0 MB/s | 6.1 MB 00:02 -------------------------------------------------------------------------------- Total 1.4 MB/s | 7.9 MB 00:05 PostgreSQL 15 for Fedora 37 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project " Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : postgresql15-libs-15.1-1PGDG.f37.x86_64 1/4 Running scriptlet: postgresql15-libs-15.1-1PGDG.f37.x86_64 1/4 Installing : lz4-1.9.3-5.fc37.x86_64 2/4 Installing : postgresql15-15.1-1PGDG.f37.x86_64 3/4 Running scriptlet: postgresql15-15.1-1PGDG.f37.x86_64 3/4 Running scriptlet: postgresql15-server-15.1-1PGDG.f37.x86_64 4/4 Installing : postgresql15-server-15.1-1PGDG.f37.x86_64 4/4 Running scriptlet: postgresql15-server-15.1-1PGDG.f37.x86_64 4/4 Verifying : lz4-1.9.3-5.fc37.x86_64 1/4 Verifying : postgresql15-15.1-1PGDG.f37.x86_64 2/4 Verifying : postgresql15-libs-15.1-1PGDG.f37.x86_64 3/4 Verifying : postgresql15-server-15.1-1PGDG.f37.x86_64 4/4 Installed: lz4-1.9.3-5.fc37.x86_64 postgresql15-15.1-1PGDG.f37.x86_64 postgresql15-libs-15.1-1PGDG.f37.x86_64 postgresql15-server-15.1-1PGDG.f37.x86_64 Complete!

So, we have successfully installed PostgreSQL 15 on Fedora.

PostgreSQL 15 post installation steps

1. Initialize the database .

sudo /usr/pgsql-15/bin/postgresql-15-setup initdb

2. Enable the PostgreSQL service

sudo systemctl enable postgresql-15

3. Now, start the PostgreSQL service on Fedora.

sudo systemctl start postgresql-15

4. Lets verify PostgreSQL service started or not on Fedora:

sudo systemctl status postgresql-15

5. Now connect to PostgreSQL server by running below commands.

sudo su - postgres psql

6. Immediately change the password of postgres user.

alter user postgres with password 'admin@123';

So in this article, we have seen how to install PostgreSQL 15 on Fedora 37. Then, we have performed post installation steps.

Watch below video the same installation:

How to find the error log location in PostgreSQL on Windows or Linux environments

In this article, we will see How to find the error log location in PostgreSQL on Windows or Linux environments.

We can get the error log location by running the command log_directory command in psql shell. Continue reading How to find the error log location in PostgreSQL on Windows or Linux environments

How to install PostgreSQL 15 and pgadmin on RHEL 9

In this article, we will show you How to install PostgreSQL 15 and pgadmin on RHEL 9.

PostgreSQL is a powerful, widely-used, open-source, multi-platform, and advanced object-relational database system known for its proven architecture, reliability, data integrity, robust feature set, and extensibility. Continue reading How to install PostgreSQL 15 and pgadmin on RHEL 9

How to start stop PostgreSQL server using pg_ctl

In this article, we will see how to start stop PostgreSQL server using pg_ctl.

We can start or stop or promote PostgreSQL server(cluster) by using following three methods.

1. Using pg_ctl
2. Using Systemctl
3. Using service

Last two methods are straight forward.

How to start stop restart PostgreSQL server using pg_ctl

pg_ctl is the utility used to start stop status or promote/failover of PostgreSQL cluster(server).
To use pg_ctl to start the PostgreSQL, we must have an already existing or newly initialized data directory.
We have to use PostgreSQL server data directory location while using pg_ctl.

Before going to examples, set the PostgreSQL environment variables using this link

Syntax of pg_ctl: Continue reading How to start stop PostgreSQL server using pg_ctl

How to install PostgreSQL on Kali Linux

In this article, we will see how to install PostgreSQL on Kali Linux step by step. In this article, we will perform below steps:
1. Install PostgreSQL on Kali Linux.
2. PostgreSQL post installation steps(Enable, start the PostgreSQL service).
3. Connect to PostgreSQL server on Kali Linux.

Install PostgreSQL on Kali Linux

Continue reading How to install PostgreSQL on Kali Linux

How to Install PostgreSQL 14 on Redhat Linux step by step

In this article, we will show you how to Install PostgreSQL 14 on Redhat Linux(8) step by step.

1. Go to the PostgreSQL official website download link.
Continue reading How to Install PostgreSQL 14 on Redhat Linux step by step

How to execute sql or script file in PostgreSQL on Windows and Linux

In this article, you will learn how to execute sql or script file in PostgreSQL on Windows and Linux step by step.

Create and Execute script in POstgreSQL on Linux Environment:

On Linux, We can execute scripts files in two ways:

1. From Linux shell
2. From psql shell

Execute PostgreSQL sql script from Linux shell:
Continue reading How to execute sql or script file in PostgreSQL on Windows and Linux