Posts

Showing posts from February, 2019

How To Install PostgreSQL 11 On Ubuntu 18.04

What is new in PostgreSQL-11 ? The PostgreSQL Global Development Group has released an update to all supported versions of our database system, including 11.2, 10.7, 9.6.12, 9.5.16, and 9.4.21. This release changes the behaviour in how PostgreSQL interfaces with  fsync()  and includes fixes for partitioning and over 70 other bugs that were reported over the past three months. To see what changed in detail you can visit  PostgreSQL-11.2 Lets move to installation of PostgreSQL-11 Step 1: Add PostgreSQL Repository to Ubuntu Very first thing you need to do is add repository key , this key is to authenticate and validate packages from repository  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" > /etc/apt/sources.list.d/PostgreSQL.list' Step 2: Update and Install PostgreSQL Now key are added, run the...

PostgreSQL Job scheduler “pg_cron”

What is pg_cron ? pg_cron is a simple, cron-based job scheduler for PostgreSQL that runs inside the database as an extension. A background worker initiates commands according to their schedule by connecting to the local database as the user that scheduled the job. pg_cron supports PostgreSQL (9.5 or higher version). Why We need it ? Running periodic maintenance jobs or removing old data is a common requirement in PostgreSQL. A simple way to achieve this is to configure cron or another external daemon to periodically connect to the database and run a command. Installation of pg_cron Assuming PostgreSQL server is already installed On Ubuntu sudo apt-get -y install postgresql-10-cron OR you can install it from source code as well - Step 1 : Download source code from git pg_cron export PATH=/usr/local/pgsql/bin:$PATH wget https://github.com/citusdata/pg_cron/archive/master.zip unzip master cd pg_cron-master/ make make install Ste...