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 1whJZx-0009HO-2B for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 04:08:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whJZw-004f2J-0U for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 04:08:08 +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.96) (envelope-from ) id 1whJZv-004f2B-2g for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 04:08:08 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whJZt-00000000APX-42d0 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 04:08:08 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2cc73e322dbso2302185ad.1 for ; Tue, 07 Jul 2026 21:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783483684; cv=none; d=google.com; s=arc-20260327; b=YXHwnwHKceyuTWFk1Ts9sha8WNwXCjtjwThHJUsdD2RKDI0CCraXuELA5uZJoy1Xe7 sggjI/Won+sIuERv4+gX1EioND+hhWOiVC6mXiinUKZ+Oa/o/N1qRZvk6hvRApIdRje1 XlzdxHx74/A9qlu51+O165glte32C+zTYKwi/cnRFeJEVn03G0AJXjBGPnyPPrlhMg8B DMDk79UwnaQE4kvVvPY2GYT6JhJhz7iwzv2JM1WsZ7avkLSXR8DGEDJ3KilV46WNeQvk YJOq/JpmRBjzRrWLp7bmCdmjckhDmG2esZ+GQktyX/xSh4xm6AMGkmExlyCwUNU7gX9l LXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CKseBccDGvM99QBWm40G+pjGAo+J13KjlP0MyaUMLvs=; fh=bWGss8nYdYJF/0tIHMr9dbOXWj15enOITwEIBCKtRYQ=; b=CAdfrMPjqlUc7rd7+NGB2f20sX9VAf9TE55OHCF/u1IrfIGNXGh3LDT98LSH4SWNAb wIr0Mv2D8rGscdhlgNFU+F8buWIW3EW8AJfrYibDCNJh/7gTRzzBwcRWvmAtVEPPuhLz wCoUyjC8E404r/OxPs93yHUp4fRRMpbDH10J1hBlGxQjsqWJtscsXzjnOGUt9MQZif7t KY2DTr+f5L3gHVdCo2CvcaXhNTsdwgYVh8ZKU4VD9DQyLuxec8nbrXTS4tvTajOrv4hr w+djcs3PELbZoQfzyKZJoj6JCAqQNdigvWf5F2qu1umBSPbdNpOlsCEb28AZvEeL6iGz twNQ==; 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=1783483684; x=1784088484; darn=lists.postgresql.org; h=content-transfer-encoding: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=CKseBccDGvM99QBWm40G+pjGAo+J13KjlP0MyaUMLvs=; b=ZX7QgKs8rIhGf28qv7l48dJG8WZR6GF2A+eqzeXUycLZ3e2tOMCxUaVcHrDfRSoUps FMl+ZAz0222CBjS2zvil7tTsEcBOKtQqOGFEWgAlgxtiZwIYbEMgahFfX6XEPcoLebKd tS+sjf6usIzXAa0KYzA215cPsZZMiidNOvnyNbIyJsV3DKCe75Ze+FhwOu2rOG7dQ1C2 ebBSRTdVyYi7jnOfqTkeJpSikBNc91+eNxU0JljThX0ndN+VEEJ5WT5np0kjgaB23bbJ YDVH0+m2SdHErb5xk5jMSpDRj1A2ze7/c1Fdd4RaxJPcx/+xrHL4NSEsSwpCGKAcfSAM bujA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783483684; x=1784088484; h=content-transfer-encoding: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=CKseBccDGvM99QBWm40G+pjGAo+J13KjlP0MyaUMLvs=; b=MIuU2NNgRWrm/LahzTy5FyGIhN3trYPM1lWmTYjrH6aIkRHpPu4w5aDz6wVQd2UYaI 7MgjJjkDYov+DVbAv/wm4Gd+VvGi3R+LtfWAv70WCplY6PSZeLHe7l9CluT73dpu3Vn2 iqYTneQ8Il1DvKMDAEEhTUzlx7QFeo+XBkvMxjNHcRkmeXgT3vzFE+vt5yBDukNtuPRv yUjsn06Av8FIaVt4Sr0Ob3rKVYgsm6v/63pth49Zy734h/pIN3sO8W66/0yuZXNnTwHo YWgRtmnn1EwTUb64a0nh/wL9bUW5VfbwcVBgYvTfiZyyb/hz9EwwzSX4CSMf3AFCoTbn tLfw== X-Forwarded-Encrypted: i=1; AHgh+RoLdIA+gqlJLp/Ta6Refz2/M/NQzikED5mkqlZ6Q98HnceUY52trjikjBZtEL3pyo4jfJWNlQFC7pKTVc14@lists.postgresql.org X-Gm-Message-State: AOJu0YygfOI/dfXyZVaBUdDx+/yGF238AKm01zyeVMfLUZsw0yyuJOX8 VwzHj5uougDgIkJKl8ZVDW+WUSTRcvmPiN5yLdq8w6F6nOXt25wq8swR6Qfhc5ZGc1xXIiAMFmL 3NHgRGQ3RmTO/fmdbpqpUoD+uEpntlK0= X-Gm-Gg: AfdE7cmTmf4DZ9Dqa8ohJEkarSerDk2boMRZFd4BQy6QEtyNlkeuVSZL2a4X4ZymkuR 1+wedudLGIk5C/0cV6X89F5u9LXnx2nb7p2QhB+4YI7ayQen7pX6WJNnUMSHZqmfacBRn/m208k SeFhc5magKhwMGRL8TLWoyNSJKVmgezrqccEfLdaPQti2N0mImOFmLecFN6comqAxtvYiK8ualH ChL7Fgmb2JaRNXJFjXYHfLE18OWS2HdfhUcV7wgwX6dxWlJzcWZaKc+hT0mdH+m1u607sBvStA6 p/d4qmycr71+qlbqtReuzPWcoleghcrL/yyLk8jtoAs= X-Received: by 2002:a17:902:ced0:b0:2c9:da58:17dd with SMTP id d9443c01a7336-2ccea48a77bmr7377475ad.34.1783483684133; Tue, 07 Jul 2026 21:08:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Wed, 8 Jul 2026 09:37:51 +0530 X-Gm-Features: AVVi8CfaxD174dMVBy2XUOq0CDTif0sH5hgodIQsOES3I-xCCGWDvX7RhscDIXw Message-ID: Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade To: Rui Zhao Cc: Ajin Cherian , Zsolt Parragi , pgsql-hackers@lists.postgresql.org, Shlok Kyal , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 6, 2026 at 6:40=E2=80=AFPM Rui Zhao wrot= e: > > 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: Thanks for verifying it. > cluster->sub_retain_dead_tuples =3D (strcmp(PQgetvalue(res, 0, > i_retain_dead_tuples), "t") =3D=3D 0); > > With no subscriptions the < 1900 query returns zero rows, PQgetvalue(res,= 0, > ...) returns NULL for a nonexistent row, and the strcmp segfaults (reprod= uced > 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 ne= eds > the same edit: > > * upgrade. Additionally, commit timestamps and origin data are not > * preserved during the upgrade. So, even after creating the slot, th= e > > 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 =3D os.local_id "); > > No ORDER BY, so the output order is whatever the heap returns; every othe= r > query in pg_dumpall.c has one. ORDER BY o.roident would keep the dump sta= ble. +1 > > 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 >=3D 905 / >=3D 90500 gates can come out n= ow that > 14d8418083 raised the pg_upgrade floor to v10. > > Thanks, > Rui