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.96) (envelope-from ) id 1wgj5p-006MID-1M for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 13:10:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wgj5o-000LcH-0w for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 13:10:36 +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.96) (envelope-from ) id 1wgj5n-000Lc8-2o for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2026 13:10:35 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wgj5m-00000001qgB-0nqV for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2026 13:10:35 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-6989c0ec3c5so6008055a12.2 for ; Mon, 06 Jul 2026 06:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783343431; cv=none; d=google.com; s=arc-20260327; b=PcA0kCvhRh0dWD+zL72vZSNSaTRLd4GL1as6eJCJXitlt4+L0ABZ3LR7mOcFQ6oYWG Nwy47LGn5IR7/RnAH1bXBNZtngUZM6XM8eje6o+gG9YzKcHsEoOeTUuOTFYxzMQFa0wB dyo9JEejFVWv+G7Hz5nBQEO9QAla7i0AqlIHnmjdNaDfOXk3PHdSSMzz5Jgp14qrUip5 KUzugv/26E/o9EFnkbDEAZRU0qfIPN9a6Gbv9Mr5n2q0NXoALodawgg5sK7CqIwn2LQz sgcKDV71E2SkkKbLwsXsPodPQwy/Z+JGbsJNXLJNMun67dlEvm/cy7QdAqwZK1ffbxL1 xylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=EPWxLZ9m4fpep69cEu0ZewH3ZkNhZAqovJ0XWNlppcw=; fh=AXWIvO4V8Qs461bUpcbP/MJkPGsLiV9HLb02TAxcjPg=; b=qF9tbgway5RbLyAZMYTVhY/XoJHBTglnyGpbo/S/Jp6zwajniiyK0VLa7M7IhkTGgi yCCmvEoQU6lMLEq5KGEtwHNSQ5xm8bioOmpsUkIpLBTQfayJuoyHXxn6PEa1TMEdTe/1 RCfeNrASmA7xoLgxpTj5S1CJKZXaHi2n04zXqR8yZLO3wkn5he5cUePirIKpXcyQg/Su nWBn4I4yEjDlujLrYN5hnRIaZholo3RXvAZCx1ERjG8DHg9GhO865RVfxk9od0RwFCl+ LYgO7EybVAHOX6EqEjIqltqlP2Koq5cOn5QLfkyeTEoMdh8+VEU0XYOKlrKw8V3xOSpU Z6WQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783343431; x=1783948231; darn=lists.postgresql.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=EPWxLZ9m4fpep69cEu0ZewH3ZkNhZAqovJ0XWNlppcw=; b=e1XtZqV8nd9ZYgyTJ8Qv+Vz/LsFAole34/oT2DxKfb+1GGWIT0O6EH/N7IAA7NC6zI aaqBDV+5gSA90hXdbDPfOebkqKZ6g5/ISVg9SXNolgv/Qo4zVonQ3hvVbCGfpWkqBLQr 05MGBCh/Kg4yyMV505dibWZ4W1zI204GaDcvTuYW6fiqH2z5u5I0nxNm3ZBlT9Xn1CSg FnBb0DbK5/RoolaTczOsie1Mkpcf1aL1BBwe/gUCq5GC0J4YKwEFdwR4iJGgo1eIeU/C /Og7whARJrugIks9oRIWPr9077tEzUiFe2IeLjaSw0t3NxIS82X6J4vdYY1Arqn35L6P GPDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783343431; x=1783948231; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=EPWxLZ9m4fpep69cEu0ZewH3ZkNhZAqovJ0XWNlppcw=; b=TGkbJGCidIzsP2Jn1OTn4BJOg3y1FgekHzVnavM2jcy563onTeJ3IS1voPS/9zqXPV Sqws+hzlDTXyG4jpH/5jWpdsX6BQOSINLaDEukA/ZrnYTy5S4Gc39fTiYvmrlJetaajE TEFn+DyHelO0eqILGub84CBndcqG4cOeUK6lrjHhzF7uWclUOV/wORzivgwyDzCVHxmd Nda98XYYANXw0mOsjmw/Iroalpbplj9RcyHP/QZADGeY/IJtCPqCZkTywjk8uC/ZPqnh aS468W8PONYocuV2Fo/EyR2/MzHknkLEnGaWPGZuS4twY6+gKtLoBIHgTb7C/chY2frD AiSA== X-Forwarded-Encrypted: i=1; AHgh+RqJVTp0PBi3Kftb2pO9Df901Jw8U7DKgdIPWxhefl6wbLtcOp1bcG7y//5ySkLO2R7iQ5HpA6KCsy7SHzX1@lists.postgresql.org X-Gm-Message-State: AOJu0Yw3YKtetf9cwZPM7nQ6WHc1nEU/vG5VyytF+KnQzm7GZwnyDO2T oyJtltceW2fhvkg0Tp8gm7KXNfqLH+6suQKZrBSJOSeRQc9aGEhXjdBG5JJoKRkVNW0GNsFLMqa Wle10ytiW0Vl410dFM8Cx+Ki3993RHgM= X-Gm-Gg: AfdE7clP6JAT1m3eIOPKvYygUvDmYzJdIiYJPYBsgTsXSVtxK3pypkeaDSBcqescf3/ kdQByslSrS81omqvaJePzffEmwb8YV21DO8vudzMQbtKj2I7FwMJiJnzxPAiZTmonmUhH7zHbh1 nP2fUVAhXGeQycvzWBe3zQa5rBooQ6GxWKMxJeUDcV1wSLJWJwxJPuQPPxqBJLWTG5px+gvQUew a5NMJItoRHXqrKIsVe1R7pQE2TSAoXT/KQsc1FpAFY7AiUnXbRd6SH3ooJ/1xTiT300alMPyFna HVtTkXmOeirg3zoQDexJIGOoil01Tf8OXuuKJc4= X-Received: by 2002:a17:906:b210:b0:c12:36ff:6eb2 with SMTP id a640c23a62f3a-c15a6841512mr19483466b.51.1783343430724; Mon, 06 Jul 2026 06:10:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rui Zhao Date: Mon, 6 Jul 2026 21:10:18 +0800 X-Gm-Features: AVVi8CcqZMB5gBZENke4bqYxrIvIXRgErGjeDlFLUJ9Axh0v4brOi2w5LFP_Uno Message-ID: Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade To: Ajin Cherian Cc: Zsolt Parragi , pgsql-hackers@lists.postgresql.org, Shlok Kyal , shveta malik Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Ajin, Shveta's right, sorry for the noise -- git am --3way applies v10 cleanly on HEAD (9d1188f298) and it builds. "git apply --check" was tripping on the shifted pg_proc.dat hunk on my end. Confirmed Shveta's (6), and it's a crash, not just a bad read: cluster->sub_retain_dead_tuples = (strcmp(PQgetvalue(res, 0, i_retain_dead_tuples), "t") == 0); With no subscriptions the < 1900 query returns zero rows, PQgetvalue(res, 0, ...) returns NULL for a nonexistent row, and the strcmp segfaults (reproduced with a small libpq program). Upgrading a v17/v18 cluster that has no subscriptions hits it. Shveta's "SELECT false" fix is right. A few more comments from re-reading v10: 1) The doc hunk updates this sentence: - Commit timestamps and origin data are not preserved during the upgrade. + Commit timestamps are not preserved during the upgrade. but the twin comment in pg_upgrade.c (~line 222) is left unchanged and needs the same edit: * upgrade. Additionally, commit timestamps and origin data are not * preserved during the upgrade. So, even after creating the slot, the 2) dumpReplicationOrigins: + appendPQExpBufferStr(buf, + "SELECT o.*, os.remote_lsn " + "FROM pg_catalog.pg_replication_origin o " + "LEFT OUTER JOIN pg_catalog.pg_replication_origin_status os ON o.roident = os.local_id "); No ORDER BY, so the output order is whatever the heap returns; every other query in pg_dumpall.c has one. ORDER BY o.roident would keep the dump stable. 3) Trivia: trailing space in the section header -- + fprintf(OPF, "--\n-- Replication Origins \n--\n\n"); and a stray blank line at the end of replorigin_create_with_id(): + false /* WAL log */); + } + +} Also, per my earlier mail, the >= 905 / >= 90500 gates can come out now that 14d8418083 raised the pg_upgrade floor to v10. Thanks, Rui