Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkdSn-0000xE-8L for pgsql-sql@arkaria.postgresql.org; Sun, 23 May 2021 02:03:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lkdSm-0002Rf-4l for pgsql-sql@arkaria.postgresql.org; Sun, 23 May 2021 02:03:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkdSl-0002RX-UF for pgsql-sql@lists.postgresql.org; Sun, 23 May 2021 02:03:31 +0000 Received: from smtp122.iad3a.emailsrvr.com ([173.203.187.122]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkdSj-0004Ow-Nj for pgsql-sql@lists.postgresql.org; Sun, 23 May 2021 02:03:30 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp16.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 7332760; Sat, 22 May 2021 22:03:28 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Subject: Re: Getting transaction details from the WAL? From: Christophe Pettus In-Reply-To: <52014f4e-b1d5-06fd-660e-b58f4f1188de@gisticinc.com> Date: Sat, 22 May 2021 19:03:25 -0700 Cc: pgsql-sql@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <72F6C54D-3787-4016-B765-45672851FD72@thebuild.com> References: <1510da2a-da65-3af7-4a83-88f5856de1fb@gisticinc.com> <52014f4e-b1d5-06fd-660e-b58f4f1188de@gisticinc.com> To: Bo Guo X-Mailer: Apple Mail (2.3445.9.7) X-Classification-ID: 4ad9b4c8-ef00-4a30-b345-5267b2d7413f-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 22, 2021, at 19:00, Bo Guo wrote: >=20 > I am wondering if it is possible to get content changes to a = particular table from a point-in-time by exploring the WAL or any other = artifacts relating to transaction management. Perhaps the easiest way to do this is to use logical decoding, which you = can use to capture changes from the WAL, converting them to other = formats. While it forms the basis of logical replication, there are = other plug-ins to the framework. You might look at wal2json: https://github.com/eulerto/wal2json or the test plugin in contrib/ https://www.postgresql.org/docs/current/test-decoding.html=