Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7SJP-005lQ4-4m for pgsql-general@arkaria.postgresql.org; Thu, 16 May 2024 04:01:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s7SJO-00FOCh-FB for pgsql-general@arkaria.postgresql.org; Thu, 16 May 2024 04:01:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7SJO-00FO8E-3Q for pgsql-general@lists.postgresql.org; Thu, 16 May 2024 04:01:46 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s7SJL-000R89-Fc for pgsql-general@postgresql.org; Thu, 16 May 2024 04:01:44 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2b992409093so1858914a91.3 for ; Wed, 15 May 2024 21:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715832102; x=1716436902; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=+rFr/UR54WOMWSrotJEOESWmHcw9Hsm5sYlaKhvnTAI=; b=Q4ocMlnsvVNRR58cyuztweLabc8yZ0dYPmcP/o6tHctUm7WtWiH/Lh0WMZohhw1HHh Y0KCrAWHaK6tc7LTPH88cc9ePTIyztmisdwgWi2CR43f9wjnGzFsEUWPBNG/gMxrs3oA HI7/B3cnB4uKKl7+/UFkVHVa1kdXW5fEw37LtE5iJ4hlq/0r//P3nBHcKWi5QlqDYOO/ Wyd33+j1wvEDnU0cebrX+AAG+gE8ymIg5x01mpSOPu2cVmhWq6q5Paqr7x+LxH/QJMJv EUauIZdNz0wkF3/Dn073NQaEfhcGtY6TFce8ZG+wmBzPs7bpXWoGmkhXj5Ai0cyS+gNB RdDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715832102; x=1716436902; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+rFr/UR54WOMWSrotJEOESWmHcw9Hsm5sYlaKhvnTAI=; b=gw5dHkC2bL7zBZRae68B9kfnC5gR/PPi3Mhxc+x89VkKqrKvrlWTTzi+5dy144IGNr Zb+24vUscErMSpIds+U68ouZz7ljXe4bdNleO766whlhD3x4MrMhlVweuG5+djVYlSbh hCF5zyFFUZwLpg7JunwIHgEJMcmJDIvjbAY4MRKCaVo4Tug29vUdmD2o9jvcqjNuYjWx DmLXik2EZNnfnvgZCVMSv8oZXB05PdTLbhV1H8AHmlCcvmzeZe5rTT6isdXnFntemTvC zJkdE4ZynKACKHZ4Im98k3rI2Gr8XtshvlcUweFV8O/Fn1E/sGQAH0jP/fvLxRFOBSko aUFg== X-Gm-Message-State: AOJu0YxH32+47xVlD3FwGTAw6anKVASeGmw/u9h2GmkF1zzFbcws148N dijeycLnxpZwFOUYMxbp/PGaSCKrVbOFnfXGoWN4sNgpD8QCeuX76oeCVJG5n5yWoPulu7w/Nxq qO3DiIRHImRGimUVMODyVgBjLyP+tyr8= X-Google-Smtp-Source: AGHT+IGW/UvtO/9ST73gbJ4oKPmTy3PG7da5JQX0DDZBUspj0sb8hOv7GdIFEJTNRAFzyCqc/gzCCXHUn1rX/RsrBIU= X-Received: by 2002:a17:90b:1f86:b0:2b9:9c5f:8049 with SMTP id 98e67ed59e1d1-2b99c5f8131mr5632473a91.41.1715832101688; Wed, 15 May 2024 21:01:41 -0700 (PDT) MIME-Version: 1.0 From: milist ujang Date: Thu, 16 May 2024 11:01:27 +0700 Message-ID: Subject: db was corrupted, ERROR: cannot freeze committed xmax; fix by deleting rows in catalog tables To: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000ea62a406188a4a0b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ea62a406188a4a0b Content-Type: text/plain; charset="UTF-8" Hi all, I have a case on pg12.9 - rhel8 which crashed a long time ago and now in log keep saying: automatic vacuum of table "dbnamexx.pg_catalog.pg_statistic"automatic vacuum of table "dbnamexx.pg_catalog.pg_class"automatic vacuum of table "dbnamexx.pg_toast.pg_toast_2619" automatic vacuum of table "dbnamexx.pg_catalog.pg_class"automatic vacuum of table "dbnamexx.ibent.loginsession_old"automatic vacuum of table "dbnamexx.pg_toast.pg_toast_2619" The problem is on the user tables: vacuum schema.tbl1_old; ERROR: cannot freeze committed xmax ... vacuum schema.tbl2_old; ERROR: cannot freeze committed xmax ... vacuum schema.tbl3_bak; ERROR: cannot freeze committed xmax ... vacuum schema.tbl4_old; ERROR: cannot freeze committed xmax ... unluckily cannot drop those tables. will return "ERROR: cannot freeze committed xmax " too figured out by pg_catcheck utility there are orphaned catalog entries, so try to fix on restore database by these DML: delete from pg_attribute where attrelid=; delete from pg_index where indrelid=; delete from pg_statistic where starelid=; delete from pg_constraint where conrelid=...; delete from pg_depend where refobjid=...; delete from pg_depend where objid=....; delete from pg_shdepend where objid=...; delete from pg_type where typrelid=...; delete from pg_type where typelem=...; delete from pg_statistic where starelid=.... and staattnum=27 and stainherit='f'; recheck by pg_catcheck, now clean. then vacuum now without error. My question: 1. is it OK DML on catalog tables? 2. Are there any impacts in the future? -- regards ujang jaenudin | Self-Employed, DBA Consultant http://id.linkedin.com/pub/ujang-jaenudin/12/64/bab --000000000000ea62a406188a4a0b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I have a case on pg12.9 - rhel8= which crashed a long time ago and now in log keep saying:

automatic vacuum of table "dbnamexx.pg_catalog.pg_statistic&q= uot;automatic vacuum of table "dbnamexx.pg_catalog.pg_class"autom= atic vacuum of table "dbnamexx.pg_toast.pg_toast_2619"
=
automatic vacuum of table "dbnamexx.pg_catalog.pg_class"autom= atic vacuum of table "dbnamexx.ibent.loginsession_old"automatic v= acuum of table "dbnamexx.pg_toast.pg_toast_2619"
<= br>
The problem is on the user tables:

vacuum= schema.tbl1_old;
ERROR: =C2=A0cannot freeze committed xmax ...

v= acuum schema.tbl2_old;
ERROR: =C2=A0cannot freeze committed xmax ...
=
vacuum schema.tbl3_bak;
ERROR: =C2=A0cannot freeze committed xmax ..= .

vacuum schema.tbl4_old;
ERROR: =C2=A0cannot freeze committed xm= ax ...

unluckily cannot drop those= =C2=A0tables. will return "ERROR: =C2=A0cannot freeze committed xmax= =C2=A0" too

figured out by pg_catcheck utilit= y there are orphaned catalog entries, so try to fix on restore database by = these DML:

delete from pg_attribute where attrelid= =3D<many id>;
delete from pg_index where indrelid=3D<id&= gt;;
delete from pg_statistic where starelid=3D<many id>;
delete from pg_constraint where conrelid=3D...;
delete f= rom pg_depend where refobjid=3D...;
delete from pg_depend where o= bjid=3D....;
delete from pg_shdepend where objid=3D...;

delete from pg_type where typrelid=3D...;
delete = from pg_type where =C2=A0typelem=3D...;

delete fro= m pg_statistic where starelid=3D.... and staattnum=3D27 and stainherit=3D&#= 39;f';

recheck by pg_catcheck, now= clean.
then vacuum now without error.

M= y question:
1. is it OK DML on catalog tables?
2. Are t= here any impacts in the future?

=C2=A0
--
regards<= br>
ujang jaenudin | Self-Employed, DBA Consultant
http://id.l= inkedin.com/pub/ujang-jaenudin/12/64/bab
--000000000000ea62a406188a4a0b--