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 1u2DrV-00EtDX-RG for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 18:39:53 +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 1u2DrT-00DwtH-Oy for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 18:39:52 +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 1u2DrT-00Dwqm-EN for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 18:39:51 +0000 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2DrR-004BdX-1Y for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 18:39:51 +0000 Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e6dee579f38so5145015276.0 for ; Tue, 08 Apr 2025 11:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744137587; x=1744742387; 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=Q2Trj23O1cuw701HpAsyCtF15AjkZZK3cwhtxS0h2gE=; b=Si9Frhecy1SFvIY7ml5uW8XuqQ1wwymV5Uj5wMRn/R7c6zZKLuGOjESKOF5wgeF8zI 9IoNVk76S/EDbyC4GxuUIjl1wQc89HjcRgamjGBiiIXJRZnYFPLA4iNUODhPRCZSjGD1 LIcJsHDTdaQgHGIwhDmS5t7QBiAheyXFzt0dm2jm9wsjk8QyJYpnRGFDK+nIDgVSZ7Uw /IoNeGTY3+WVwv2Rfio/OV/px4VRpbq6Y7DhJv6EJOManWVnHrWJIvlcfLbEw4AdYqBu /oqOIsT4T63I3L2mlRuXveJ+pu060v8SAcV6R757wG+9Mu6BXUC6Yjc20CVOcB8AONs/ dQwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744137587; x=1744742387; 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=Q2Trj23O1cuw701HpAsyCtF15AjkZZK3cwhtxS0h2gE=; b=Yv0UQn2fXtfje7tada0GxLHndOBkuWCPneSfoqaXFvUXFZOCjbb9NB7wQIQAugre+9 H3ZCdvshtpZq0Hwob5HgmrjQNu5KwP1hbH5ZV9QEbeFpy15I4WTXY+V7r+TJBYtvgF64 tPlK8HVmVDnOkcEoUhFXkfvgp2LfL9iGBK7V1uY8nR8aNIMOujg5ulV5M0PpfrmjuWDX dUkMxjrp/RUV6y4VY/agHiTbswrS7NPzc+S4KFCPtaW1Frhw9BXXojNK5lJjyJ16KphH pod5LOuqSU9NJc1qfU3lVrnXEDdDhExsMkzAQcQFA7kfgCdCw4dQFjrBoTG7PsPhwFzF nHKA== X-Forwarded-Encrypted: i=1; AJvYcCVXU6DUGCNj8vp6hjs7ZwidLmqwe4+2SF+deS+so23mbTF/9JtjFAZ/huxpdCzrmM23P2DNPRUWpKc4AJzA@lists.postgresql.org X-Gm-Message-State: AOJu0Yz3hGBvQZ4cq/0T/TYa8VCstUHZIkPLXR5PcU5B/p4fbwJpRC0D Zy2hrjXiw+tjElnmuvq56E7pEa8z8/Kn9dIIUPmWKGiKfR5oWsTb X-Gm-Gg: ASbGnct1jdK1ngvyWQVUNiZp+6wAZ8j0a6jl+z3hwAT7ktt2plS05s9tjKhjzssH/4n 8gtGsj+YUk/UYI79uFS79qjU52d1cs9OERhIfIr36WZGGuWKolBLSqSnGeke7o3sj+rjWvQBCgj s+JxxQjhtJ39RTewhzTwwhZsPJBXAP0EFveQrbkn3KSWpW2knnJaLpPs3Hd05lqYaIGdz/ABnIV PdhZ3kQb8HYslOpQugdMZ48UjaQflZGArSmamKOh2+8c23a6zKcRSVJxp4nh6no1wPcYV7tUzUF j9vd+8m7uUa+xwd30tDaC38HxYxKKzQJ1OXDu3zsAYLBWEh49/gA1lZGnxV6WQphxGLcaWUIjLc TQLH3XKhUC3cl7XzNJWkrr6atEplwNB2abAo= X-Google-Smtp-Source: AGHT+IEPuzGJOoJVWCzd9FVg0nFe+eKn+pCu0GGxlVCpfRvHuFBK3sKTtfpjLBnF1tOF3BoU2Nn9Iw== X-Received: by 2002:a05:690c:74c9:b0:6fd:4900:bae1 with SMTP id 00721157ae682-705387d4603mr4930947b3.1.1744137587298; Tue, 08 Apr 2025 11:39:47 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 00721157ae682-703d1e828a3sm32749597b3.66.2025.04.08.11.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 11:39:46 -0700 (PDT) Date: Tue, 8 Apr 2025 13:39:45 -0500 From: Nathan Bossart To: Tom Lane Cc: Hannu Krosing , PostgreSQL Hackers Subject: Re: Horribly slow pg_upgrade performance with many Large Objects Message-ID: References: <4044567.1744128814@sss.pgh.pa.us> <4047312.1744130263@sss.pgh.pa.us> <4050387.1744132029@sss.pgh.pa.us> <4054965.1744134140@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4054965.1744134140@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 08, 2025 at 01:42:20PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> Unless I'm missing something, we don't seem to have had any dependency >> handling before commit 12a53c7. Was that broken before we moved to SQL >> commands? > > Sounds like it :-( Huh. Sure enough, it seems to be lost during an upgrade from 9.6 to 10. v9.6: postgres=# select lo_from_bytea(1234, '1234'); lo_from_bytea --------------- 1234 (1 row) postgres=# create role bob; CREATE ROLE postgres=# grant select on large object 1234 to bob; GRANT postgres=# drop role bob; ERROR: role "bob" cannot be dropped because some objects depend on it DETAIL: privileges for large object 1234 v10 (upgraded from v9.6): postgres=# select lo_get(1234); lo_get ------------ \x31323334 (1 row) postgres=# drop role bob; DROP ROLE If I then try to upgrade that database to v17, it fails like this: pg_restore: from TOC entry 2422; 0 0 ACL LARGE OBJECT 1234 nathan pg_restore: error: could not execute query: ERROR: role "16384" does not exist Command was: GRANT SELECT ON LARGE OBJECT 1234 TO "16384"; I've also verified that the dependency information is carried over in upgrades to later versions (AFAICT all the supported ones). -- nathan