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

PostgreSQL Foreign Data Wrapper for Oracle on Windows OS

The foreign data wrapper is responsible for fetching data from the remote data source and returning it to the PostgreSQL executor. If wrapper must support in updating foreign tables. In this post, I'll demonstrate, how you may connect PostgreSQL database to Oracle database using oracle_fdw . Before going ahead kindly ensure that PostgreSQL is installed in your system . Let’s begin: Step-1 Software’s used in demo - Windows, PostgreSQL 9.5, 9.6   instantclient-basic-win-x86-64-11.2.0.1.0 instantclient-jdbc-win-x86-64-11.2.0.1.0   instantclient-odbc-win-x86-64-11.2.0.1.0 instantclient-sqlplus-win-x86-64-11.2.0.1.0 & Oracle_FDW as per version ( http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html   , https://pgxn.org/dist/oracle_fdw/ or version wise)   Download all the files mentioned above, in a single folder and unzip entire files to this single folder. Suppose, we create a folder Oracle in c: drive ...

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