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 1kDYPP-0002Wb-Nh for pgsql-general@arkaria.postgresql.org; Wed, 02 Sep 2020 19:27:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDYOs-0003Yv-O5 for pgsql-general@arkaria.postgresql.org; Wed, 02 Sep 2020 19:26:30 +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 1kDYOs-0003Ym-Ab for pgsql-general@lists.postgresql.org; Wed, 02 Sep 2020 19:26:30 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDYOl-00070e-L7 for pgsql-general@lists.postgresql.org; Wed, 02 Sep 2020 19:26:29 +0000 Received: by mail-qv1-xf43.google.com with SMTP id h1so140471qvo.9 for ; Wed, 02 Sep 2020 12:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=KvLV7XuDfGSD9NUrYy+6SD0q3bYY64JYdRwUgu2EGik=; b=oYnzIFWJuvITndZm+XEuenPpKiQWXOkzt1Ayz0yKVs5aIVVUHmq3QfpbZci/DU/t87 fAyT3UV8+R7mIUrsJhQCixuVq4B+Gmvm/ySZuARiuoqiMJG/7SrP4Ol5kziG8yjqHY1W y9GPYab48fQZW6gsIAw5b+ahyOHaylMofjJT57zVDGPfX4B78rXirKID5Gqm4uG7FroJ lFk62XL44YMTSk0GnbDE75zgTjBxK3LEcYLyNE+Exz0DDih4DM77nw6dhof9cGSzD1TV rWxOWXmvpdRtJCUY7XlPDu8xkKRLg8ER55uqAWPqNGmX46yMe8cRVWplasC+mZuIkqph PvZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=KvLV7XuDfGSD9NUrYy+6SD0q3bYY64JYdRwUgu2EGik=; b=N8t6ZhPVQoMJv9ncW+GTlYiSgkOpEmLzNYmMNnlAyxEpB0PiK4BFoNIsxjuMiSQ6+t dfApFFkEPHJG/nZMu1LDJ+pXVUPjq52tgxbDpfar0sRW6Y5WOzgIo0qONfTLrfITwbpJ bkpGliO4kmihhxDzROMBmsGJurbAL4IUetKYqPlL456bXmi1WXCpa5feP0VP0NC7Ro3M PfwnnoSH9yK/HE4j/5/pSQDuwTEFFR7gzrkI6b2a4/bsSiKuBrUX1bpzDuTf7HY1nAJN k474Gj9FgEfMZ5XRN7QaG7I3234kdD3aXbWOwpWzzvmWkFHcbeZEw3MGxhnINYWdRGT2 ph/w== X-Gm-Message-State: AOAM531UXBKPCQyfkNjwaxyJQ/Y/xKVBlT11I74qflr1UDA6cRRlzVgs djv0CLhV+pLesXMblFNQYsDzxg== X-Google-Smtp-Source: ABdhPJyGbukMrPLEmKwz0QspiTf5tDm42S7jPr003KcQFrxXv0L0mBbOBBW+GVimHOkSch3tyt78Lg== X-Received: by 2002:a05:6214:a85:: with SMTP id ev5mr8401136qvb.1.1599074782777; Wed, 02 Sep 2020 12:26:22 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id f13sm467434qko.122.2020.09.02.12.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 12:26:22 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 580DD2A1565; Wed, 2 Sep 2020 15:26:20 -0400 (-04) Date: Wed, 2 Sep 2020 15:26:20 -0400 From: Alvaro Herrera To: Tom Lane Cc: Lionel Bouton , pgsql-general@lists.postgresql.org Subject: Re: Reconstructing transaction content after the fact Message-ID: <20200902192620.GA26472@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <338420.1599065418@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Sep-02, Tom Lane wrote: > Lionel Bouton writes: > > Are these t_xmin values ever cleaned up (by VACUUM or another mechanism) > > ? If positive is there a way to configure the approximate time during > > which these values can be recovered ? > > See VACUUM FREEZE. You couldn't hide connections immediately after > insertion, but if the idea is to sanitize every so often, it'd help. Starting with 9.4 which introduced the use of HEAP_XMIN_FROZEN combination in infomask to replace rewriting the xmin value proper, the Xids will be preserved by freezing, so that won't help. One option to hide the xids might be to recreate the tables every once in a while, with something like BEGIN; LOCK TABLE votes; DROP TABLE IF EXISTS votes_copy; CREATE TABLE votes_copy AS SELECT * FROM votes; DROP TABLE votes; ALTER TABLE votes_copy RENAME TO votes; -- recreate indexes, if any? COMMIT; which will make all rows have the same Xmin. Since the voting process involves a human act and the tables are not expected to be enormous, it might not be totally out of the question to do this after every vote, or in the worst case, once every minute or so. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services