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 1uwpzl-007rNk-4D for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Sep 2025 22:42:25 +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 1uwpzi-00ANNM-UM for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Sep 2025 22:42:23 +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 1uwpzi-00ANN9-BN for pgsql-hackers@lists.postgresql.org; Thu, 11 Sep 2025 22:42:23 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uwpzg-001v6A-0t for pgsql-hackers@postgresql.org; Thu, 11 Sep 2025 22:42:21 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-24cdd95c422so8556925ad.0 for ; Thu, 11 Sep 2025 15:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1757630539; x=1758235339; darn=postgresql.org; h=user-agent: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=hYhwOZXDZqeKg0tNiSLCFhPg0pf76m79kuN6curfSW8=; b=Y4a0tvbAGZVZLSh5SzgGTA/sn8YFjKp2AfsZc46v6lHd+rPsTjUB2IM5/RcO8gwSOS jcNnXjDiyujxgWJTLuN1GS7QxTaOoL5JJ1svTJQpXY25iQHmT3Hy3fyImN8GxozwJ6cf p6V/9R/+pVzot87eedFqMPqEawv3Ec/geklGA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757630539; x=1758235339; h=user-agent: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=hYhwOZXDZqeKg0tNiSLCFhPg0pf76m79kuN6curfSW8=; b=Oqvbs4rcpsiywkPvVpyLVM0j++JvdlW+vZlYRy0Uj7ppRDFN4Yb7O+vySSTXefbTHw VOnHn2r8aySi+TAWR9pHR2JAiLj+sW20nVCEVwhLMCpeuZ92Y1CpzKvSGUPXK0bzZ7S5 ahPyA73pyldDq44cNuEhZDa+/wZpRGosCJ6BL7Rm5Npj9dccuIJ39AwzQmF3f2LIKzk2 M6IE9wys2sid5UnLVXS84CuJHPM9pdnwM2UdvtquCIoNepEpUwVz9NIfYItyKtqNgRmR QmNSmI59S0kUDkPjqs7bPW6cuaEzsoActWqKmIgf8dMV8YQG5xSYsvHTdM8s/iGq/9ps tKkQ== X-Forwarded-Encrypted: i=1; AJvYcCVSjyXgyxaYIOefdgAKAhTtVE7IbrHXgV5qtozWrm2FdQJJDrgZQEEjAlIUnUBTik836vQVho2Po1g0jSwU@postgresql.org X-Gm-Message-State: AOJu0YzIdnm/s5lXv4KB1xfiofegiWHfaIrhaQAaf+yLch3b0O3R3+Ys tBwObXR65tosAwj6MNhvtzOyeCXTAUbCMy+0wgxaKyZJsgQfCCy4aYhQIG1iNgQxVA== X-Gm-Gg: ASbGnctqTpQF6BfPN7TKF7QA/+8V9/e6zBUrE17DcN8IpHYb+RAmJF+j9+XhkSd4QyZ WxueWkpukip/XQlDqJW7qd2hNGdcUd5x2jrUPYxo8L9Hp7HnLEvWZtofl/yHPEOH1R3m8uWrTl1 jErc2+FVSw/LvuRsdfXi1VglBJUDy+QYNOJ2cbh4tom310u64ZiE+PL7gkvvO4M6AfyMEIs4Lvu nisqM+w8xnYBalH4iOsxuJLGEjrnhzSzxszmT+RqPImKEpO/BZfOUD0gpqV3SHDMXspPuu2vPHT Kvntta2Gm9a178Hr5MCkBxO6T0TEnGD2iSvPsCf+xT0JvaCV6XON+U3AiK08eEmAzDotddEWaNh ET8hcXgA5iU03glbmFgbfUyGZ1XvIMcgIfIScuEXwA3k6KchXWJgzVOqsARv9CA== X-Google-Smtp-Source: AGHT+IFfGNXsjPxe3/9Qklni0Wi9ZE10rMt7vVvsdR4h7sP2eK60Z6uPMVXgh2Q26B0bQPM10kf6uQ== X-Received: by 2002:a17:903:248:b0:249:2360:6af2 with SMTP id d9443c01a7336-25d24baff8emr9214255ad.16.1757630538816; Thu, 11 Sep 2025 15:42:18 -0700 (PDT) Received: from google.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-25c3b304f1csm28601865ad.135.2025.09.11.15.42.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Sep 2025 15:42:18 -0700 (PDT) Date: Thu, 11 Sep 2025 15:42:16 -0700 From: Noah Misch To: Tom Lane Cc: Smolkin Grigory , pgsql-hackers@postgresql.org Subject: Re: race condition in pg_class Message-ID: <20250911224216.4f.nmisch@google.com> References: <20231027184832.9b.nmisch@google.com> <1596629.1698435146@sss.pgh.pa.us> <20231027214946.79.nmisch@google.com> <1617596.1698446455@sss.pgh.pa.us> <20231027232612.99.nmisch@google.com> <20231102030915.d3.nmisch@google.com> <20240512232923.aa.nmisch@google.com> <1802710.1757608564@sss.pgh.pa.us> <20250911185729.ad.nmisch@google.com> <1826823.1757619287@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1826823.1757619287@sss.pgh.pa.us> User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 11, 2025 at 03:34:47PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Thu, Sep 11, 2025 at 12:36:04PM -0400, Tom Lane wrote: > >> It emerges that the "ALTER DATABASE regression_utf8 RESET TABLESPACE" > >> command is a complete no-op [1]. I am guessing that that was not the > >> behavior you had in mind, and am wondering if we are losing any test > >> coverage thereby. Did you have a specific reason for manipulating the > >> TABLESPACE property and not some random GUC setting? > > > I have no specific notes or memories about that RESET TABLESPACE, but I likely > > wanted "SET TABLESPACE pg_default". RESET TABLESPACE may still have the > > effect of loading a catcache entry, as a later comment says: > > ... > > I'm inclined to change it as > > attached. This doesn't reduce database.sql test coverage of dbcommands.c or > > catcache.c, so I'll bet it doesn't lose anything vs. the original database.sql > > commit. Some check-tests runs showed it adding database.sql coverage of > > catcache.c:1908-1911 and catcache.c:1983-1984, so that's a bonus. > > Thanks, that looks sane. > > > Do you plan to back-patch that? That should dictate whether I back-patch the > > test change. > > That change will convert some commands that are currently no-ops into > errors, which doesn't seem like a great thing to do in minor releases. My default would be no back-patches of the above, but one could defend either choice. The "error if some pg_db_role_setting entry exists, else no error" behavior (postgr.es/m/1791672.1757607520@sss.pgh.pa.us) means the no-op outcome already isn't 100%. That reduces the risk that someone is relying on the no-op, but some risk remains. > However ... it might still be okay to cram it into v18. Do you have > an opinion about that? Feels like something I wouldn't do, but I don't have a concrete reason.