Skip to main content

Posts

PostgreSQL Minor version upgrade

Here I am going to upgrade minor version of PostgreSQL12. In my example Database is PostgreSQL12.7 and OS is Centos7. Now, I am going to upgrade it on PostgreSQL12.8.   Step 1. Before upgrading or doing anything on any server please take a backup of your entire database through pg_dump or pg_basebackup or through any other tools.  Step 2. To see your current version of PostgreSQL Database  [root@test /]# su postgres   bash-4.2$ plsql   postgres=# select version();   output :   version  ----------------------------------------------------------  PostgreSQL 12.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit  (1 row)  Now exit from PostgreSQL. postgres=# \q   bash-4.2$ exit   Step 3. Stop PostgreSQL server  [root@test /]# systemctl status postgresql-12.service  [root@test /]# systemctl stop postgresql-12.service   Step 4. Download latest rpm of PostgreSQL12...
Recent posts

Install PostgreSQL 12 on BOSS8 (Bharat Operating System Solutions)

Bharat Operating System Solutions  ( BOSS GNU/Linux ) is an  Indian   Linux distribution  derived from  Debian . BOSS Linux is officially released in four editions: BOSS Desktop (for personal use, home and office), EduBOSS (for schools and education community), BOSS Advanced Server and BOSS MOOL. The latest stable version 8.0 ("Unnati"), was released on 15 October 2019. It is developed by  Centre for Development of Advanced Computing  (C-DAC) in order for enhancing and gain benefit from the usage of Free and Open Source Software throughout India. BOSS Linux is a key deliverable of  National Resource Centre for Free and Open Source Software  (NRC-FOSS). It has enhanced  desktop environment  integrated with  Indian language  support and other software. https://en.wikipedia.org/wiki/Bharat_Operating_System_Solutions PostgreSQL is included in the official BOSS repositories, but not in version 12 but in version 11. Install Post...

pglogical on PostgreSQL12( logical replication )

pglogical is a logical replication system implemented entirely as a PostgreSQL extension. Fully integrated, it requires no triggers or external programs. Logical Replication extension for PostgreSQL 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades. In my example to configure pglogical I used two systems 192.168.1.93 for provider(publish) and 192.168.1.120 for subscriber (subscribe).Both systems are on Centos7. Step 1. Install PostgreSQL   I assume that on both systems PostgreSQL12 has already installed. If not installed use below link [root@pc1 ~]# yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latestpglogical.noarch.rpm [root@pc1 ~]# yum install postgresql12-server postgresql12-contrib [root@pc1 ~]# /usr/pgsql-12/bin/postgresql-12-setup initdb [root@pc1 ~]# systemctl enable postgresql-12 [root@pc1 ~]# systemctl start postgre...

Partition and Subpartition in PostgreSQL12

Partitioning refers to splitting what is logically one large table into smaller physical pieces. Partitioning can provide several benefits: • Query performance can be improved dramatically in certain situations, particularly when most of the heavily accessed rows of the table are in a single partition or a small number of partitions.  • When queries or updates access a large percentage of a single partition, performance can be improved by taking advantage of sequential scan of that partition instead of using an index and random access reads scattered across the whole table. • Bulk loads and deletes can be accomplished by adding or removing partitions, if that requirement is planned into the partitioning design. Doing ALTER TABLE DETACH PARTITION or dropping an individual partition using DROP TABLE is far faster than a bulk operation. These commands also entirely avoid the VACUUM overhead caused by a bulk DELETE. • Seldom-used data can be migrated to cheaper and slower...

Database Security postgreSQL

We know that in today’s world protecting your system is a must. However, there are number of ways to protect and remove malware but no one ensures your system is secure, there always loophole for hackers in any terms. So we can use different layers of protection to minimize the risk of hacking. (1). listen_addresses: Informs PostgreSQL which IP addresses to listen on. This usually defaults to localhost or local, but many people change it to *, meaning all available IP addresses.   It is a good practice to allow connections only from the known ips or your network, and avoid general values like listen_address = “*” or “0.0.0.0:0” or “::” , which will tell PostgreSQL to accept connection from any IP. (2). Port: Change the default port 5432 by modifying the value of the port parameter within postgresql.conf file. (3). pg_hba.conf : This file controls: which hosts are allowed to connect, how clients are authenticated, which PostgreSQL user names they can use, which...