Wednesday 8 April 2020

FATAL: requested timeline 3 is not a child of this server's history


When we perform a switch-over, the replica fails to start with below errors.

Switchover - master server and warm standby (with streaming replication) in PostgreSQL


Switch-over of a master database to replica is pretty easy. Lets see how we do it.. 

 I have 2 servers : 5522(data_replica2) and 5432(data), and at this time, 5522 is the master server and 5432 is a warm standby with streaming replication. 

Wednesday 25 March 2020

pg_dump: aborting because of server version mismatch

Initiating backup using pg_dump keeps on failing with error as below :

pg_dump: [archiver (db)] query was: LOCK TABLE

While performing backup using pg_dump with database user fails with error as below :

pg_restore with -C option fails to create database. FATAL: database "nexaprod" does not exist

When you use pg_restore you have various options available, for example : 

-c to drop database objects before recreating them,
-C to create a database before restoring into it,

Thursday 19 March 2020

initialise multiple postgres instance on same RHEL server


It is pretty easy to install multiple instances of PostgreSQL servers on same server and have its benefits.

Who uses Postgresql

A good read Who uses Postgresql 

Tuesday 10 March 2020

How to stop starting of clusters while starting up services


Infra activities such as upgrade, OS patching or Sevrer maintaince activity may require disabling the auto startup of any specific cluster or if you want  NOT auto start on a call such as sudo service postgresql start

pgtune | installation and usage

 pgtunepgtune helps expands the database server to be as powerful as the hardware it's being deployed on , by taking an existing postgresql.conf file as an input, making changes to it based on the amount of RAM in your server and suggested workload, and output a new file.

Monday 9 March 2020

pg_basebackup: could not connect to server: FATAL: number of requested standby connections exceeds



-bash-4.1$ pg_basebackup -h oracleasm1.localdomain -D /u01/PG_Adventure
pg_basebackup: could not connect to server: FATAL:  number of requested standby connections exceeds  

pg_basebackup : could not connect to server: FATAL: no pg_hba.conf entry for replication connection


pg_basebackup: could not connect to server: FATAL:  no pg_hba.conf entry for replication connection from host "127.0.0.1", user "postgres", SSL off

Monday 21 October 2019

Postgres Drop table : ERROR: must be owner of relation table_name


In Postgres, The right to drop an object is not treated with any grantable privilege. It is only achived by the ownership. How .. ?

Thursday 29 August 2019

Creating a database on Postgresql server


1.    Login to PostgreSQL server

[oracle@oracleasm1 ~]$ su - postgres
Password:
-bash-4.1$
 
-bash-4.1$ psql
psql (8.4.18, server 9.6.15)
WARNING: psql version 8.4, server version 9.6.
         Some psql features might not work.
Type "help" for help.

Installating PostgreSQL Server on CentOS, RHEL 6 / 7 Systems


This article will help you for installing PostgreSQL on CentOS, RHEL 6 / 7 Systems