Skip to main content

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 
[root@test /]#yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm 
[root@test /]#yum install postgresql12-server 
Now your server has been upgraded by new minor version. You can check it with below commands.
root@test /]#su postgres 
bash-4.2$plsql 
postgres=# select version(); 
output : 
version 
---------------------------------------------------------- 
PostgreSQL 12.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit

Comments

Post a Comment

Popular posts from this blog

SSL configuration in PostgreSQL for PgAdmin

SSL configuration in PostgreSQL for PgAdmin This document describes how to set up SSL to enable ssl connections from PgAdmin on some client machine to postgresql on a server machine. In my example, I am using Centos 7 for PostgreSql-9.5 server and Windows for PgAdmin.The assumption is that Postgresql (compiled with ssl support) and openssl are already installed on the server (Linux Centos7). PgAdmin is already installed on the client (either Windows or Linux). On the server, three certificates are required in the data directory. root.crt (trusted root certificate) server.crt (server certificate) server.key (private key)  On CentOS7 default Data directory is / var/lib/pgsql/9.5/data/ : Now, connect your system with user root. Step 1 Su – Go to data directory [root@localhost ~]# cd /var/lib/pgsql/9.5/data/ Out put [root@ localhost data]# Step 2 : Generate a private key (you must provide a passphrase). [root@ localhost data]# ope...

Performance tuning PostgreSQL - Basic query tuning concepts

There is no any hard-and-fast rule for query tuning or server tuning. All are depend on your business requirement(logic) and H/W capacity. If all you are on Linux, your total physical RAM should be larger than your database size on disk in order to minimize I/O. Eventually if the entire database will be in the OS read cache and I/O will be limited to committing changes to disk.  This blog is divided into two parts. In this part, I am writing on some basic ideas related to improve query performance. In second part I‘ll write on Server parameter setting concepts. There are some points we have to take care when we write any query.   1. Limits your data when you are joining(using) a table in many times in a SQL query(SP). Example, suppose we have a table XYZ in this table we have millions of records and more than 50 columns and this table XYZ are used many times in SQL query and we need only 5 to 10 columns on the basis of some condition. Then it is always better to cre...

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...