Problems with autovacuum during high load on server

I last days we had big spikes in number of inserts on some of our databases causing rapid increase in “database age” (i.e. growth of transaction ID) and some of our databases have reached alerting level of transaction ID value set to 1 billion . See in the...

Transaction ID wraparound error

Up until a few weeks ago I thought I will never see transaction ID wraparound error on some of my databases. Not that I would miss it but it felt like something with very very low possibility of occurrence. Well, not any more… We implemented logical replication...

Parallel run of queries / functions / tasks using dblink

PostgreSQL has one problem which limits scalability. One process / session / connection can use only one CPU / core. Therefore if you want / need to run several queries / tasks / functions in parallel you have to use dblink functions to open more parallel connections...

Transaction ID wraparound

This article summarizes information I have about this problem. I know that this is not all but I did not find such a summarization anywhere therefore I place it here. Maybe it could help to someone.   Transaction ID has 32 bits. It means that after ID 2147483648...

Autonomous transaction in PostgreSQL

I think this is really very well known. I add it here only as a reminder. In Oracle you can define “pragma autonomous_transaction” to force your procedure make changes in data regardless of any other pending transaction. This is really useful when you need...

Find newly inserted records / Identify changed tables

Do you need to identify newly inserted records in some table? Of course you can add some special column of yours which you will update. But this solution is not much useful when you have really big amount of data because PostgreSQL deletes all old records and inserts...