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 1utSEe-007Wtn-Ae for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Sep 2025 14:43:49 +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 1utSEc-003zhf-33 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Sep 2025 14:43: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 1utSEb-003zhH-NR for pgsql-hackers@lists.postgresql.org; Tue, 02 Sep 2025 14:43:46 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1utSEa-000Ano-1L for pgsql-hackers@lists.postgresql.org; Tue, 02 Sep 2025 14:43:45 +0000 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-88432e60eebso137573939f.3 for ; Tue, 02 Sep 2025 07:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756824223; x=1757429023; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=niN3mRwWhrMm5IpruA5/tRAdXD7L3T6KQ9tLTeZnOUw=; b=U6C+PDbD5eQeDqE1tz583shnQYLE3N7ejyP9Z4Bd7205I1J6iXb5mcZUnk8v0JVjca gXqKJraaZTHK9fR0O4lMj6FALZARYnV44tPHQoXSo0sy6yc+21/vtDdgXPZGQ3HlCONX hvE8UdTk0W7QGA57AdqgJ3XPbWfpIGY5bVApoLIgPO7CB+LDId+KjbaiOEHQFrpDgMMk qFVf77T+JlPZ+5FJK6+05XniOSv6tfCYJ2rpPnMtnOYVZsc/DabduG6mVFvlWG5KqN9n +VdBqhyn93gHYWypAJvnA5CGN4xa7puQCPfPZVpyfnw2C3772gljeBNFDu5s5WnqHCKs myoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756824223; x=1757429023; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=niN3mRwWhrMm5IpruA5/tRAdXD7L3T6KQ9tLTeZnOUw=; b=HFQEByuWAbG8zEzVeu4q+om7ln48B4mW10m3tvIn1oTTOf+zTYYyFXx4YnwJeedHtB CzPzzy8oW2CjcV2wk8C0emabxqMpicCfQVByDG8+dops7L2lAUrYIOQTJe/8IFmeDh4F CNHYHziWVev+2L4CoFhsrVpv8Dyyw6FucaGdJWHcxeMcsFZX7fhrToXv3GmWeyVjJP+q /SGEBCbZThoWkNDRDn68K1qtWjUdctVUupzsqzV6EgT0xlTP9tXYS0e5yToloI+53G9Y Wqw8J9kmd3CsAlWrpX5jWfPjrFKUrC5oPusO9bbph2KaGau8DBwoEGqso7sQHHMlkJZI cqdw== X-Forwarded-Encrypted: i=1; AJvYcCWl78w2ialLEN0g0bjtoOdQJfxr0XaUHbB4T+R44YksoAv9YFK8uxeDTKN1EsL6Fspq/UyKBogxREqnOQQI@lists.postgresql.org X-Gm-Message-State: AOJu0YxhIvIySPIqAk4UyHtIOGHghLTh9JBaRKpOQ0dwbedqlDwTfLLV 7HI6DcMzxJJb28B/b5GeN94lnl0eG5HckxhPDW8c1+bPWpR0qTx1qxyo X-Gm-Gg: ASbGncuYpdsJ3PpCZtsQnoiwYTRmBLKPwdfaM7XzztW4Evuiu3l3KgPdELFHyPG8DWC 8+MMxV5YMDeyPhMtsicwtkWFv8ktu8umGw09qiswELIJ5U4eOn4kDJXSJ849VuBvVbb4uJThz+x be/aIGBFIi6SZAgeFpWkKIwm90OSZ9NpiH6HeVthvuNjWjq3V75XtexKIVF/MRVWjYN5jliddXU /6Oh08To7fOzomRqW8UoI3ifA3R8Iws1Hthd//FK54FaCXRNzr+8TkMeobOQLUZ2DbSL9fu6VPX vXVHF0eNV9UOXyKPy4DgTeC9QzYdDZwAYQMZ7Vl6CI+lEI5ZM7jlmLAPeV8grr4JlHSRcqZecNF +pdZqpv7HRlSJsMhSkwmskR+4khe0eUr5qpWjRqcaSWEUI41vE5DBNiBy2gvwTvc6A+ZQRvV07L nRPCBd3Bs4VJfZufwtQCaoRrI= X-Google-Smtp-Source: AGHT+IEktGoQTNVHK2gwLjdl3p2k3rxgJy8AHOBqBM2H/eJBRlX3iw91XEEU558YgzG+jQGw1+o0rQ== X-Received: by 2002:a05:6602:3d4:b0:887:109c:afb with SMTP id ca18e2360f4ac-8871f2229d1mr2105750539f.2.1756824223441; Tue, 02 Sep 2025 07:43:43 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-50d8f0a4be2sm3220470173.11.2025.09.02.07.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Sep 2025 07:43:42 -0700 (PDT) Date: Tue, 2 Sep 2025 09:43:40 -0500 From: Nathan Bossart To: Michael Paquier Cc: Tom Lane , Nitin Motiani , Hannu Krosing , PostgreSQL Hackers Subject: Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Sep 01, 2025 at 03:19:46PM +0900, Michael Paquier wrote: > I highly doubt that there are a lot of comments assigned to LOs, so > these numbers are pretty cool IMO. Security labels are a pain to test > in the upgrade path, or test_dummy_label could be extended with a new > TAP test and a pg_upgrade command.. There is some coverage with > comments on LOs in src/bin/pg_dump's 002, so that would be enough for > the comment part, at least. Do you think a new pg_upgrade test for security labels is worth the trouble? It seems doable, but it'd be an awfully expensive test for this. On the other hand, I'm not sure there's any coverage for pg_upgrade with security labels, so perhaps this is a good time to establish some tests. > - /* > - * pg_largeobject > - */ > if (fout->remoteVersion >= 90300) > appendPQExpBuffer(loFrozenQry, "SELECT relfrozenxid, relminmxid, relfilenode, oid\n" > "FROM pg_catalog.pg_class\n" > - "WHERE oid IN (%u, %u);\n", > - LargeObjectRelationId, LargeObjectLOidPNIndexId); > + "WHERE oid IN (%u, %u, %u, %u);\n", > + LargeObjectRelationId, LargeObjectLOidPNIndexId, > + LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId); > [...] > appendPQExpBufferStr(loHorizonQry, "\n-- For binary upgrade, set pg_largeobject relfrozenxid and relminmxid\n"); > + appendPQExpBufferStr(lomHorizonQry, "\n-- For binary upgrade, set pg_largeobject_metadata relfrozenxid and relminmxid\n"); > appendPQExpBufferStr(loOutQry, "\n-- For binary upgrade, preserve pg_largeobject and index relfilenodes\n"); > + appendPQExpBufferStr(lomOutQry, "\n-- For binary upgrade, preserve pg_largeobject_metadata and index relfilenodes\n"); > > Is all that really required when upgrading from a cluster in the > 9.3~15 range? No, that stuff is discarded for upgrades from those versions. My intent was to maintain readability by avoiding lots of version checks. FWIW I originally put all of the pg_large_object_metadata stuff in a separate block, but that resulted in a lot of copy/pasted code. I'm happy to adjust it as you see fit. -- nathan