Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXpsO-0000Ko-B1 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 17:04:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXpsM-0003CK-Ve for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 17:04:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXpsM-0003CD-IX for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 17:04:14 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iXpsI-0005T7-Kt for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 17:04:13 +0000 Received: by mail-pg1-x52a.google.com with SMTP id b126so1898747pga.6 for ; Thu, 21 Nov 2019 09:04:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=46AEVRw8K4b5s+G+oTi+0WoEszmQj7j7dcx0tVplIOI=; b=bIXIeZXORkCsUQd8fF8HUUlWOu4fZLOD3/fPq2viUiGbrW7Fjpz3NCM4GaV0GHxSME z8aNR78QwR/GFsjtxVcndMniUWY6Asqw8pwVMLwu7i+Zr2fgxPxeNcUyNlXxWDNpTPgs Y6Q5cB6g+XStbLJQt1Qf/xn087YBnBbmxwH9F9BCyXPdaGHa0GIAEa4a1fKXnBnObpJ5 0xW6maj0tLXCFbD4kmLXA9hGihijGBBNxQOk7q9pZfdBoc8iGJP88AYtAXlyi4Am83mt vW51/msfTdToKQNQo57gI9Nwr378QMaBFnt9rFImBFr8QJF1tNXwNe08iULXrpekT3QO DpDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=46AEVRw8K4b5s+G+oTi+0WoEszmQj7j7dcx0tVplIOI=; b=DJWe4z7MIVN+NgAh1uwbByakEN+Z3KuVBxOjyIgQ9GUobYRzL9A7Yj8Stz6Aqpiwex SKSFQRhK/9RtDRPB6YfxzPVcRIAoHq+duJZGIVko/Aa+1QWUNVIQeXU+0CqlZOJgiOFd xgc7Ggm1AYdrxpGNmdfAirvULC7g7rtbH8sqMdRlftdnJfStRtDkv6yY2UCek9aCs+Fl tzvBdQCGtTJF70ZIXr5FGxs9j8pPMwsMa9RtSEmY1YN/eapXRb5tZYdOV882ttpRgyTj 2XnMNk0rHIQYk3K0q3pn7Y0dtemZB/i63It/2BI4qioDVap9QprVjjv3kcFjeWvJxFxR ipHQ== X-Gm-Message-State: APjAAAXID79qagnArLZDMqkNLMYCt1XkgWFdi0lB/+6v3ZQSTAzjeA/h MS9ikL9zEkXmk+/mn/e0A8g= X-Google-Smtp-Source: APXvYqwUaRLq2lZLlSgcDgOPFWod3b4pe1zHodDZCBgn6RTQ9YBC7deXwVXEfNGls7eiYpWItSELZw== X-Received: by 2002:a63:4a01:: with SMTP id x1mr10653848pga.312.1574355847736; Thu, 21 Nov 2019 09:04:07 -0800 (PST) Received: from [10.106.131.252] ([155.100.47.4]) by smtp.gmail.com with ESMTPSA id e8sm3830887pga.17.2019.11.21.09.04.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2019 09:04:07 -0800 (PST) From: Rob Sargent Message-Id: <2679CE43-A0FE-4399-B146-2D3504E55403@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_A2EB1C5A-F9D2-45A4-9CFE-074037BC68F6" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Extract transactions from wals ?? Date: Thu, 21 Nov 2019 10:04:06 -0700 In-Reply-To: Cc: Laurenz Albe , "pgsql-general@lists.postgresql.org" To: Marc Millas References: <355aa1f83ee7bf0b2f5296f46cf231fb1384b409.camel@cybertec.at> X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_A2EB1C5A-F9D2-45A4-9CFE-074037BC68F6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 21, 2019, at 9:35 AM, Marc Millas = wrote: >=20 > Hi Laurenz, >=20 >=20 > I was writing select from ""table"" as a template. We have to do this = for a bunch of tables. > So, to my understanding, what you suggest is to PITR up to the first = timestamp, extract all meaningfull tables, and then pitr to the second = timestamp > so as to be able to script a kind of "diff" between the 2 to get what = I want. >=20 > Yes ? >=20 > Marc MILLAS > Senior Architect > +33607850334 > www.mokadb.com >=20 >=20 >=20 > On Thu, Nov 21, 2019 at 5:16 PM Laurenz Albe > wrote: > On Thu, 2019-11-21 at 17:07 +0100, Marc Millas wrote: > > you say "extract the data you need" > > That is exactly the point of my question, as the PITR step was = obvious. > > How to guess "what is the data" I need ?? >=20 > Well, you asked for the contents of a table AS OF TIMESTAMP = . >=20 > That means you know which table and which timestamp. >=20 > So restore the PostgreSQL cluster to that timestamp, connect > and SELECT from the table. >=20 > Yours, > Laurenz Albe > --=20 > Cybertec | https://www.cybertec-postgresql.com = >=20 Are you by any chance logging sql at a sufficient level of detail to = allow a restore to PIT and sql replay? --Apple-Mail=_A2EB1C5A-F9D2-45A4-9CFE-074037BC68F6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Nov 21, 2019, at 9:35 AM, Marc Millas <marc.millas@mokadb.com> wrote:

Hi Laurenz,


I was writing select = from ""table"" as a template. We have to do this for a bunch of = tables.
So, to my understanding, what you suggest = is to PITR up to the first timestamp, extract all meaningfull tables, = and then pitr to the second timestamp
so as to be = able to script a kind of "diff" between the 2 to get what I = want.

Yes = ?

Marc MILLAS
Senior = Architect
+33607850334



On Thu, Nov 21, 2019 at 5:16 PM Laurenz = Albe <laurenz.albe@cybertec.at> wrote:
On Thu, 2019-11-21 at 17:07 +0100, = Marc Millas wrote:
> you say "extract the data you need"
> That is exactly the point of my question, as the PITR step was = obvious.
> How to guess "what is the data" I need ??

Well, you asked for the contents of a table AS OF TIMESTAMP = <something>.

That means you know which table and which timestamp.

So restore the PostgreSQL cluster to that timestamp, connect
and SELECT from the table.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com


Are you by any = chance logging sql at a sufficient level of detail to allow a restore to = PIT and sql replay?

= --Apple-Mail=_A2EB1C5A-F9D2-45A4-9CFE-074037BC68F6--