Re: Diffs in PG output vs WAL

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: V <avinash(at)verloop(dot)io>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Diffs in PG output vs WAL
Date: 2022-09-01 17:19:05
Message-ID: 67D234AC-093E-4DCD-8C17-118EADB08840@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Sep 1, 2022, at 10:14, V <avinash(at)verloop(dot)io> wrote:
> I want new/old tuples with pgoutput. how?

I assume here you are reading the pgoutput protocol directly.

Logical decoding sends out two tuple structures:

1. The replica identity of the row (in the case of update and delete).
2. The new row data (in the case of update and insert).

If you want to get the entire content of the old row, you'll need to set the table as REPLICA IDENTITY FULL. This is something of a hack, and *greatly* increases the data volume, so you may want to use the subscribing side for the old tuple (perhaps captured with a trigger).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matheus Martin 2022-09-01 19:20:13 Re: Missing query plan for auto_explain.
Previous Message V 2022-09-01 17:14:24 Diffs in PG output vs WAL