How to uninstall PostgreSQL from Ubuntu

In this article, we will see how to uninstall PostgreSQL from Ubuntu.

Important Note: I suggest you to take backup of your important PostgreSQL databases. Once we uninstall, all your PostgreSQL data will be lost.

1. Stop PostgreSQL server using below command.

sudo systemctl stop postgresql

Continue reading How to uninstall PostgreSQL from Ubuntu

How to get the current Unix timestamp from PostgreSQL?

In this article, we will see how to get the current Unix timestamp from PostgreSQL?

The unix time stamp is a way to track time as a running total of seconds. This count starts at the Unix Epoch on January 1st, 1970 at UTC.

Getting the Unix timestamp from a postgresql timestamptz like now() is simple by using either of below queries.
Continue reading How to get the current Unix timestamp from PostgreSQL?

How to get Postgresql version

In this article, we will how to find out the PostgreSQL version. It is simple process but with different methods. We can get the Server and client versions from Linux shell or using PostgreSQL commands.

PostgreSQL Server version from Linux shell:

Continue reading How to get Postgresql version

How to restart PostgreSQL on CentOS 7

In this tutorial, we are going to see process to restart PostgreSQL on CentOS Linux Distribution by two methods.

Restart PostgreSQL by using systemctl command:

systemctl restart postgresql-10

Restart PostgreSQL by using service command:

service postgresql-10 restart

How to Start and Stop Postgresql server on Linux

In this tutorial, we are going to Start and Stop Postgresql server on CentOS 7 Linux distribution.

How to stop PostgreSQL Server on Linux:

To get the service name run the below command on Linux:

systemctl list-units|grep postgresql


systemctl stop postgresql-10 or service postgresql-10 stop


To verify the PostgreSQL server status:
systemctl status postgresql-10

How to start PostgreSQL Server on Linux:

systemctl start postgresql-10 or service postgresql-10 start


To verify the PostgreSQL server status:

service postgresql-10 status

</pre