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 1vBx7x-007ENt-Fb for pgsql-general@arkaria.postgresql.org; Thu, 23 Oct 2025 15:21:20 +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 1vBx7v-009kUD-Qm for pgsql-general@arkaria.postgresql.org; Thu, 23 Oct 2025 15:21:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vBx7v-009kU4-FC for pgsql-general@lists.postgresql.org; Thu, 23 Oct 2025 15:21:18 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vBx7s-003pL5-0U for pgsql-general@lists.postgresql.org; Thu, 23 Oct 2025 15:21:18 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-430ab5ee3afso8866385ab.2 for ; Thu, 23 Oct 2025 08:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761232874; x=1761837674; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=I4/yrAsOO3lYavIMQlnrCMb5eAxhvNrYCnJ6ArZ6yHk=; b=fs9DFwMfev8Ondn6/p/XeJOk0fc8sk3WCCJfMI4/gDM6gT9HoB9t258l5WX2sgOtyR tVsiiGL878PJy4k3Rft6nwXq/vA0u6IdoqYdndFKqfuvmMiZ7zDdqHZtKxEMHFADw4iG RtaZhOAlFWsdAPpsbF/Gbmga9BLxLCo1OBL5Rw+bmXeoVKgqcbLMCYJxftmuFZRpJLl/ P+Q6MI+3oKuyMVgSZoxGjQVS+BZPY3igXWgLDzpHoiCg6CiEd0vxtkVXxTvoPJ8BNGz2 OlBhOSHFzBQOn4tP407pO2woHMmeWIiNMDvJ/c7DDaD0SMIemQw0MRw5TCOmyMAT/Udx jyjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761232874; x=1761837674; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=I4/yrAsOO3lYavIMQlnrCMb5eAxhvNrYCnJ6ArZ6yHk=; b=KCZ+fMVcFQ5EHur2HV71SBSqMI+8HOUq2pbI7D4NkvsqedgX9lv4KCRxyl8zVcz/rF KouXmV8Gngdgw6pK2YGr92GhjdhiiE2gEwg6WmJ8Nm4rHq7atF/9Z9qMcuZ47GnsUk+h seKoEobMRvn0RdbVkYYpf+2OO0iZGDj2JEqpgyvX8lFc48OfXjUwb+9XKYRW1aEFx8fu 4cYX5Qke7hBkDjWYFqIj8DrD2i7C3DKGFhkxBr3+aWLmUDqwXb02ou7RBY9BJ9HbhN1H nuptAs+cYZd91oXIHSZVQXd1LoiFgFkSD1ldJ9WwKttp61l+Nme2tTMyqH0OsnTtjksY 44Lg== X-Forwarded-Encrypted: i=1; AJvYcCWTDJ5mDJbehKbzpvG3i/zjGqI7zjrADlsg2B7BshsMNgzx3vCjHtp6lu0uZON9z4rVEgeuMt5mNoMTrp5M@lists.postgresql.org X-Gm-Message-State: AOJu0YwxTvoCMqHCdjcmmn1rOfyKjGt32OqRFOvM6Bp0sNslmNUbzDGE yXTcXf6OikcuqJLamghRJ8QVIk4hwBRSr3bKOVgIgki8Exe1hqPzcyGXJ00ci3dqXSR0jv73zSG j5hkMBD4pFce+SMD3RXbfcAU19V0N0kM= X-Gm-Gg: ASbGncuzp9pbjeaglYvvWGgRY3/lx6S+PfJ19OhaAWiVY0eF7NDZ7BUxoixpD5LbILj Lz48f3EN0XBTf42KvZuccAf6bvIyJBOSuZgblNJXvoywQDTojxOklOIHMMOvsGrhUjMpnqWyjII giS85oeQsK+fFyTSDueTDFE9aTNOVQbyF61CtTcSpTmNtBWRReOd6SZXDX6C+wjX3RhdouhE8ji OHErP0dsdD9wtYORWimvJ/0rRIvGRgmo/CUIe3EHRUNN44SDE/e7oCBE+Sra2nYywiDzq52wlke M9ijtBrE4qEz351CIh0jB88MJaEqsw== X-Google-Smtp-Source: AGHT+IGzpJjiPy/Sa0GHNTfnsRAWzqYebJXoPSUfGdtP0kd3xw6RD55rvjtYOiChoRBMjCAuOfo9fBBafHMB6pRtZAE= X-Received: by 2002:a05:6e02:2218:b0:431:b1fe:147f with SMTP id e9e14a558f8ab-431b1fe1670mr138805725ab.18.1761232874079; Thu, 23 Oct 2025 08:21:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Thu, 23 Oct 2025 11:20:38 -0400 X-Gm-Features: AWmQ_bnJgHO6yhpQ2iRgS0uL8M03SYxL9XzzqDqFrYGRUspNJ5VwKnzn26aR_Lc Message-ID: Subject: Re: Index corruption issue after migration from RHEL 7 to RHEL 9 (PostgreSQL 11 streaming replication) To: Bala M Cc: "adrian.klaver@aklaver.com" , chris+google@qwirx.com, pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d38fc10641d4fbb6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d38fc10641d4fbb6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > > - > > *Acceptable downtime:* ~1 day > - > > *Logical replication:* Not feasible due to the number of schemas, > tables, and overall data volume > > I'm not sure why this is not feasible. Can you expand on this? * For a *15 TB database* with roughly *1 day downtime*, what would be the > most reliable approach to migrate from *RHEL 7 =E2=86=92 RHEL 9* while av= oiding > collation/index corruption issues? pg_dump is the most reliable, and the slowest. Keep in mind that only the actual data needs to move over (not the indexes, which get rebuilt after the data is loaded). You could also mix-n-match pg_logical and pg_dump if you have a few tables that are super large. Whether either approach fits in your 24 hour window is hard to say without you running some tests. * Would using *pg_upgrade* (with --check and --clone options) be safe when > moving between OS versions with different glibc libraries? No, you cannot use pg_upgrade for this. It can move your system across Postgres versions, but across servers/operating systems. * If we temporarily remain on PostgreSQL 11, is it *mandatory to rebuild > all indexes* after restoring the base backup on RHEL 9 to ensure data > consistency? Would running REINDEX DATABASE across all databases be > sufficient? Yes, and yes. * Are there any *community-tested procedures or best practices* for > migrating large (15 TB+) environments between RHEL 7 and RHEL 9 with > minimal downtime? Yes - logical replication is both battle-tested and best practice for such an upgrade. But with such a large downtime window, investigate pg_dump to v18. You can find a large table and dump just that one table to start getting some measurements, e.g. run from the new server: pg_dump -h my_rhel7_server -d mydb -t mybigtable | psql -h localhost -d mydb -f - Make sure log_min_duration_statement is set on the new server to help you see how long each step takes. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --000000000000d38fc10641d4fbb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=
  • Acceptable downtime: ~1 day

  • Logical replication: Not feasible due to the number of = schemas, tables, and overall data volume

I'm not sure why this is not feasible. Can you expand on= this?

* Would using pg_upgrade (with = --check and --clone options) be safe when moving = between OS versions with different glibc libraries?

No, you cannot use pg_upgrade for this. It can move your system ac= ross Postgres versions, but across servers/operating systems.
* If we temporaril= y remain on PostgreSQL 11, is it mandatory to rebuild all indexes after restoring the base backup on RHEL 9 to ensure data consistenc= y? Would running REINDEX DATABASE across all databases be suff= icient?

Yes, and yes.=C2=A0

<= /div>
* Are there any community-tested procedures or best practices for migrating la= rge (15 TB+) environments between RHEL 7 and RHEL 9 with minimal downtime?<= /blockquote>

Yes - logical replication is both battle-te= sted and best practice for such an upgrade. But with such a large downtime = window, investigate pg_dump to v18. You can find a large table and dump jus= t that one table to start getting some measurements, e.g. run from the new = server:

pg_dump -h my_rhel7_server -d mydb -t mybi= gtable | psql -h localhost -d mydb -f -

Make sure = log_min_duration_statement is set on the new server to help you see how lon= g each step takes.


Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

--000000000000d38fc10641d4fbb6-- 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 1vDkyn-00F9YE-F1 for pgsql-general@arkaria.postgresql.org; Tue, 28 Oct 2025 14:47:20 +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 1vDkyl-00DRcI-B9 for pgsql-general@arkaria.postgresql.org; Tue, 28 Oct 2025 14:47:18 +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 1vDkyk-00DRcA-VL for pgsql-general@lists.postgresql.org; Tue, 28 Oct 2025 14:47:17 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDkyi-004DrV-1K for pgsql-general@lists.postgresql.org; Tue, 28 Oct 2025 14:47:17 +0000 Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-9444425cedcso378923439f.1 for ; Tue, 28 Oct 2025 07:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761662835; x=1762267635; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jupzQKtUPUSbW+jyeIpZ4la1wk8yN8C6pzrpMVXH6VQ=; b=XkqgmlZzvibHhq7KhFR/Kg43qw5n0J3Tyy38YOxAYyjd53bcLb+TtsV8Eo3hDOsqMh IHsWqA8fJRFkNK8+5HNmbGs22ygAxwGgAC2O5wu8q56oQfObLvKQpO+NB29OMNPKvFDV YP694jRmdwEBUHCMwot9yAUEIuthIjQzg6zSKUaQRewbID3UiFa+cVy68uPqZpWy7OyR pGOgjC2swzViLPyD2f11GH26jO/yK0TGzz8VMGp5XnZJoY6BCkAEwV03X11juQkJXXwV tCxZX4/bZa4vF0GHmLzlV1d5W32d/Fbsna2zPusSI6Rcxjp5egZRvrUs0vqG3jke/T/m kfYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761662835; x=1762267635; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jupzQKtUPUSbW+jyeIpZ4la1wk8yN8C6pzrpMVXH6VQ=; b=xOu3Tr6IIfYkqOZ+E9Pgti11UtLnXXCLkICYJAFJnt3cRtfrQYfx21uVAo8/SPUH2n KGeBVn+iyZafuzH4Xss60ThxW6Z6ZiTyQkDqztwukMYlkohaZ6bIhNpUFGMdmJtOb/Tx ulhdN6tfRuJgccBev4LQNScarr33npVXqgeTzyoU955fwMn7E1T0nCmIAQkOiO19BD3x ePMG2Z+CoUvQXIAP+o1cKe4aLSrgtEeBCEViOGjC1+vdvhZ2om356fKq7TbQgi2mqyKZ 2EAwGq75G8UAQwMbrrFr9SQsBOeJBTRONsjg6llYb6b4xEHjt13vSP1XiVOTv0NUM+MG pTyQ== X-Forwarded-Encrypted: i=1; AJvYcCUXJ67QTVPIfNZIf0xz1dWhgxJnT3TXbYY1tVVDsd9tIEGD16+qxjo7C1yiHImBE0u2GNVxG5BEwmx7IN8+@lists.postgresql.org X-Gm-Message-State: AOJu0Yy4nXvQYWvXtO1mTByi69bP1qpoGht/0knaeb8M6vMv1W+vBr7T r6Xcbdizi3HV1zrF+QfBGR0zGA3UZNGuHVUh8yMfXvP3TSb8PLHT0/vs1wlrMQrzjiZuHkeqFv2 yUSYT3cmWF0VB54Ir/jJX7WxQv45EiC1uu+qr X-Gm-Gg: ASbGnct3QsUqpC1aChobc+sqXzhFY1W1Nhyo86AxMV1QA0YbW3mifSQQ3QjLx62W/4O Kub/BhYuWinBN32pdBhYESjWNF7CAPJu5U9reG7OIgt6XZBCjdg63s4xBDmYjOkPsGEZnRYfoyf caxGXVFfBSamjyVUThS+oA0Dt0n9OniJalqqbci6XwdpOYz0Qw9aQRgG+5nS7DbMI2cvr8KSXxt BX1ejCfLUja3/H4S2G92E/NMquLvwnILmqJw0ym6/FeoFOmzVPKvqLA0xSjKIymOxEOWhgcK/Dz pUSXsjTEjgtE8E8Hvg== X-Google-Smtp-Source: AGHT+IHQNqPeu0zvNUpo9TwYjuZdeSakY2xJVQZZF7FaZH0IbI23pKBzJB6t8YuhIoq5RHZthNTmedipP+Lr49Nme5k= X-Received: by 2002:a05:6e02:1a03:b0:431:b1fe:147f with SMTP id e9e14a558f8ab-4320f771042mr63324155ab.18.1761662835319; Tue, 28 Oct 2025 07:47:15 -0700 (PDT) MIME-Version: 1.0 References: <1bfa0b6b-11a8-458f-a3f3-3f86574abc1d@aklaver.com> In-Reply-To: From: Greg Sabino Mullane Date: Tue, 28 Oct 2025 10:46:39 -0400 X-Gm-Features: AWmQ_bmdxMgbbDKYvffU_VtP9lPAiTk4Gcej2HouJeg2dVIdWgSlE-xffESGOWE Message-ID: Subject: Re: Index (primary key) corrupt? To: Wim Rouquart Cc: Adrian Klaver , "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000836a890642391710" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000836a890642391710 Content-Type: text/plain; charset="UTF-8" Could you run the SELECT on pg_index after the REINDEX to see if there is any difference? --000000000000836a890642391710 Content-Type: text/html; charset="UTF-8"
Could you run the SELECT on pg_index after the REINDEX to see if there is any difference?
--000000000000836a890642391710--