Upgrading Slony-I 2.0.x to latest version 2.1.x

Slony-1 2.1 has very good fixes and new features like adding Bulk tables, improvement on WAIT FOR with Merge Set/Move Set, support for TRUNCATE on replicating tables and many more. Am using Slony-I 2.0.7, so thought of upgrading it to latest version. Upgrading Slony-I is very simple and it can be achievable in few steps. My upgrade procedure assumes there is already Master/Slave setup with Slony 2.0.7. Backup Plan: Backup the existing slony schema (_slonyschema) of master/slave Backup the OLD Slony Binaries Backup all initially creates slony configuration files.

Continue reading →

Compiling PL/Proxy with PostgresPlus Advance Server 9.1

PostgresPlus Advance Server 9.1(PPAS) isEnterpriseDBproduct, which comes with enterprise features as additional with community PostgreSQL. Most of the contrib modules(pgfoundry) can be pluged into this product using Stackbuilder. However,currently Pl/Proxy is not bundled or downloadable with Stack-builder. So,here is how you can compile the Pl/Proxy with PPAS 9.1. Download Pl/Proxy. wget http://pgfoundry.org/frs/download.php/3274/plproxy-2.4.tar.gz tar -xvf plproxy-2.4.tar.gz make PG_CONFIG=/opt/PostgresPlus/9.1AS/bin/pg_config make intall PG_CONFIG=/opt/PostgresPlus/9.1AS/bin/pg_config Note: Flex & Bison must be installed before compiling pl/proxy.

Continue reading →

Autonomous Transaction in PostgreSQL 9.1

Currently am working on Migrations from Oracle to PostgreSQL. Though am DBA, these days am learning a bit on Developer track too … :) Let’s see a small feature of Oracle and a similar way in PostgreSQL. Autonomous Transaction,what is it ? An autonomous transaction is an independent transaction that is initiated by another transaction, and executes without interfering with the parent transaction. When an autonomous transaction is called, the originating transaction gets suspended.

Continue reading →

Caching in PostgreSQL

Caching…!!, its little bit hard to go in brief with single article. But will try to share my knowledge learnt from Heikki / Robert Haas / Bruce Momjianin short. In PostgreSQL, there are two layers, PG shared buffers and OS Page cache, any read/write should pass through OS cache(No bypassing till now). Postgres writes data on OS Page Cache and confirms to user as it has written to disk, later OS cache write’s to physical disk in its own pace.

Continue reading →

Duplicate Rows in a primary key Table.

Back again, getting very less time for blogging :) “ERROR: could not create unique indexDETAIL: Table contains duplicated values."This error is thrown out by Postgres when it encounters duplicate rows in a primary key table by failing any of these command REINDEX or CREATE UNIQUE INDEX. Why duplicate rows exists in a table ? Not sure exactly :) nor any proved explainations out… Two thing to my mind. Firstly, it might be delayed index creation or if you have shared sequences in a database, sharing on two different Primary key Tables might be the cause while restoring the data into table (pg_restore).

Continue reading →