AFTER LOGON(Oracle) trigger in PostgreSQL with extension – login_hook

Before going into the details, thanks to the author of ‘login hook’ extension for developing and maintaining it. Many times, in Oracle to Postgres migration exercise, I have seen the use of Oracle Database Event trigger – AFTER LOGON ON. Its one type of Oracle database/user event trigger(LOGON) that fires when a user connects to…

Fixing up a corrupted TOAST table

Today, when taking a logical backup(pg dump) of a database cluster table (PG 9.4), we saw a toast table error. pg_dump: Dumping the contents of table linkhistory failed: PQgetResult() failed. pg_dump: Error message from server: ERROR: unexpected chunk number 6 (expected 2) for toast value 1876670 in pg_toast_185452 pg_dump: The command was: COPY public.linkhistory (key,…

Install PL/Java 1.5.2 in PostgreSQL 11

PostgreSQL 11 includes several procedural languages with the base distribution: PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python. In addition, there are a number of procedural languages that are developed and maintained outside the core PostgreSQL Distribution like PL/Java (Java), PL/Lua (Lua), PL/R (R), PL/sh (Unix Shell), and PL/v8 (JavaScript). In this post, we are going to see…

CREATE LANGUAGE plpython3u – PostgreSQL 9.6

This is one of the quickest blog am publishing :). I am publishing from my terminal as is of my testing to create language plpython3u. Using trusted or untrusted distributions of python we can create plpython3u language in PostgreSQL. In my testing, am trying with SCL distribution(am not recommending, I tried for testing) of python3.3…

How to rotate PgBouncer logs in Linux/Windows ?

Before doing a deep dive into the subject, a short outline about PgBouncer, its a lightweight connection pooler for PostgreSQL that dramatically reduces the processing time and resources for maintaining a large number of client connections to one or more databases. Typically used to increase the number of user connections that can be handled in a…