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 1iXnqh-00047s-5I for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 14:54:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXnqf-0001PQ-Ni for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 14:54:21 +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 1iXnqf-0001PJ-9t for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 14:54:21 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iXnqc-0004PM-SA for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 14:54:20 +0000 Received: by mail-wr1-x441.google.com with SMTP id z3so4786257wru.3 for ; Thu, 21 Nov 2019 06:54:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=CloMv0LbcMwhjHkF7M8CpZ0xhJfvTv1N2lmYD/vGoV0=; b=1dXj5i1HAnJToz3t6j9atnaxRwaOtRTsw6zij73GNprQNFFi5R9kTYGNbfKSP6CJkk 7rOgJ5rCc0lge9N7TLy2ZpiaGiJpWKcQUjiymFXBRH+ijPz/CATHD0gOv1lX5Q22bUNK r+JFlbiXTCGY/pkV+m/0SAuVAwHUkGPWZUapLxl8B5iweRoXr7h8wBVcVDd1rtYGpmRA YmbKvQsorvXhxCQZY1/uW9YPHXoGVT3CXxyQf4bK1GaTSDP4QAnmW1CVM0vOWi8sCQu/ CgBSKTt31MBhskH9XUDdsdoXmAOHbdGUq+JboadGeVlRTvn9FiI+iujOqeoGZp6ztz6o rtxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=CloMv0LbcMwhjHkF7M8CpZ0xhJfvTv1N2lmYD/vGoV0=; b=EzawP/o8ZOubq8eWBQMlp/HGtYERd5pflay3MT6qUz7/ByGQcWfTik2UB7WTvvVE5s oBY2SC+7GZrT3x/C7vOXGF+NsAaPrEjAJx6aWfv+sFAX0c11AJCJGnqv4q24CHMvHojn V9Y9YFKY3t70J/Sm/7R5s+Y0rXRimLO2hQE0x8IGXLEt86jqmYvcBttApkMhk2N7hoRO h/lsqRXX+Ri3b4+Mz2HcHCSxgyvAelUzKrpAhlfWZNKOBcYgA6E2rhl7tm+i/vi/zR5O 2MPE5jQy4/jQAMGpXpyp+TA0wKzPB1tfZ4ps9RqDunVXUXtwNJi/W11ex6UCuq9Bh9Mr gmlg== X-Gm-Message-State: APjAAAWR/B8eHZtttvudW2WcEEvEZbtKbmmxy5FC1Rq48sD/o5y0vpAo 9yVblulIPM3BUZw4nTFG2/KYR/EKQ0I= X-Google-Smtp-Source: APXvYqykqiyDiBiYZChm1svROjzcAMKmyROSmVw5yPY9adMC7G4Ctrus8UWp/VkZOYFu0rA4aPRiKw== X-Received: by 2002:a5d:670a:: with SMTP id o10mr11626047wru.312.1574348057119; Thu, 21 Nov 2019 06:54:17 -0800 (PST) Received: from localhost.localdomain (217-149-171-82.nat.highway.telekom.at. [217.149.171.82]) by smtp.gmail.com with ESMTPSA id h15sm3906048wrb.44.2019.11.21.06.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 06:54:16 -0800 (PST) Message-ID: <355aa1f83ee7bf0b2f5296f46cf231fb1384b409.camel@cybertec.at> Subject: Re: Extract transactions from wals ?? From: Laurenz Albe To: Marc Millas , pgsql-general@lists.postgresql.org Date: Thu, 21 Nov 2019 15:54:16 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2019-11-21 at 14:50 +0100, Marc Millas wrote: > due to a set of bugs and wrong manip, an inappropriate update have been done into a production DB. > After that, quite a long set of valuables inserts and updates have been done and needs to be kept. > Obviously getting a backup and applying pitr will get us just before the offending update. > Now, we need to find a way of extracting, either from the ex prod db, or from the wals, the "good" transactions to be able to re-apply them. > > This did already happen on a Prod Oracle DB, and recovering was possible with a : > select * from table_name AS OF TIMESTAMP TO_TIMESTAMP('09052019 0900','MMDDYYYY HH24MI'); > to get most things done after the problem. > As we are currently moving out of Oracle, we must prove to the business people that our new postgres env is fine. > So, ... any idea ? Sure. Restore a backup and perform point-in-time-recovery. Then extract the data you need. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com