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 1mLiTA-0005t1-Ty for pgsql-general@arkaria.postgresql.org; Thu, 02 Sep 2021 08:53:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLiT9-0005VA-TO for pgsql-general@arkaria.postgresql.org; Thu, 02 Sep 2021 08:53:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLiT9-0005V2-Fr for pgsql-general@lists.postgresql.org; Thu, 02 Sep 2021 08:53:11 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mLiT6-00038h-EN for pgsql-general@lists.postgresql.org; Thu, 02 Sep 2021 08:53:10 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 192-20020a1c04c9000000b002f7a4ab0a49so707020wme.0 for ; Thu, 02 Sep 2021 01:53:07 -0700 (PDT) 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=hZvif+QoiBeheP6VZbVauD44oCzZIi3YRF/svzbzOiM=; b=fSWNZ3R+m591T6nKR5FzdoiGbhrG1UHtc/zod5ZAthyiuhVC631HqwG3aV2pq8PJ+f tR5eEhfuy/W6X2l11FkrflAPpjLWICPkZuGxYQQVIKz30KKBkeue2DhvI7DJfc80EtSP Q7e7weGmRLb4fZKpHYI7kJ2BhGuprj8/Yut1Gs7DXIz2YUa+xDHczj2I8KNCwdOSifIb nj7tivnmfpzcS2aCk+o/efgdvE1Eu+k3DVazVP3zBUQdxqZNH6mNawD0PkaJOiC/QvNL 3lDjPVoE/Hyf3EsgwykZt5Oj/L+WH/ErOOsKzskgC5RtbvR6zCIvx2K8wl0nQQZKzmw3 IjqA== 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=hZvif+QoiBeheP6VZbVauD44oCzZIi3YRF/svzbzOiM=; b=j+9ROMBllYZS4mLgMiHGzZJLKtuK+CPszzgPMp5jBdXee3zNJi8f25oUF+UnqlrdQp joQgEHhXRCUHH945bFksaUWN6oQHJt1tyioGLK78EI75A5xF+4g+MDacD7YNSxnEnNjP w2c+pjOWZn97iAal+ItEOkKtKUDy60xnQhiHOeZ2IhtsxXQJIVBR/NoTcKYKIi5kh3jk WpMhGdZvjDAxIyOfLyxOQ/+CYuoZx15IbR9E3kz7CcPQsk56jmL/AYtghUnpvoSFp5AH W3anmLs8hVCPLYyu+RwQh1w5PjAhYtBrde2RBlJ8PvF4gYYtgQU7b1fvQngaBSZ1d+1x 0zFA== X-Gm-Message-State: AOAM532RXFuCXc1pfH8TGrTYRaNhDqWoByjEzx0Q/S2D03fBVWZdrj8U ojhyNMxF0CE1miNtrX/USRjB0DDuS00SmQ== X-Google-Smtp-Source: ABdhPJx2lasUVriTQLwOGwi0S0WS6Elxnask5lorWl+ihdQygt9z/7AR0AtxZ2k7G9XiRZRjbW9sHw== X-Received: by 2002:a1c:a78a:: with SMTP id q132mr1987165wme.91.1630572787336; Thu, 02 Sep 2021 01:53:07 -0700 (PDT) Received: from localhost.localdomain (dynamic-e1udl52juwqyd3ngc-pd01.res.v6.highway.a1.net. [2001:871:5c:80af:7c70:4be5:5ab3:2e7c]) by smtp.gmail.com with ESMTPSA id l124sm1049157wml.8.2021.09.02.01.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 01:53:06 -0700 (PDT) Message-ID: <0cea1cb2929da04dc46a2fb198a7b54dc260cc17.camel@cybertec.at> Subject: Re: No xmin in pg_database From: Laurenz Albe To: Alexander Kass , pgsql-general@lists.postgresql.org Date: Thu, 02 Sep 2021 10:53:06 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2021-09-02 at 08:50 +0300, Alexander Kass wrote: > Hi! I'm Alexander from DataGrip. > We actively use xmin's from pg_catalog tables to incrementally > synchronize our database model. > We have a small number of users that do not have xmin in pg_database > (we've asked them to try `select xmin from pg_database` and got > `column xmin does not exist`). > There is an old ticket https://youtrack.jetbrains.com/issue/DBE-7588 > (at that time there was no real need in that xmin so we just removed > it) > Now xmins are back and so are the problems. > The most recent report is about version `PostgreSQL 12.4 (Ubuntu > 12.4-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu > 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit` > > How can that happen that there is no xmin in pg_database? > Is it a normal behaviour and that is configurable? Or is this a kind > of data corruption? > Can that happen to other tables? > > I haven't been able to find answers myself, so I'm asking for help :) > Thanks in advance All PostgreSQL tables have "xmin", and all catalog tables do as well. If you use a non-standard table access method, a table might not have "xmin". But that cannot apply to catalog tables. Perhaps that was not really PostgreSQL, but some fork where the persistence layer was modified? I am not sure if it is a good idea to rely on "xmin" at all. These numbers are recycled when transaction IDs wrap around, and you could have two entries with the same "xmin" that have a totally different meaning, because one of the rows is frozen and the other isn't. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com