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 1sQyag-00Ceny-L2 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 00:20:18 +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 1sQyaf-00Ax8C-AO for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 00:20:17 +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 1sQyaf-00Ax6x-0R for pgsql-hackers@lists.postgresql.org; Tue, 09 Jul 2024 00:20:17 +0000 Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sQyac-0017HG-Iw for pgsql-hackers@postgresql.org; Tue, 09 Jul 2024 00:20:15 +0000 Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-64e81cd12cdso34260017b3.0 for ; Mon, 08 Jul 2024 17:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1720484414; x=1721089214; darn=postgresql.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0ik7q/PZr/sdmOUEtW0lUUBXX6ahyLieksvQYFUjpHM=; b=gwBBVpahJqBMt8PA0n+vhkP7ALz0qX8hGXp8tuLfTIxuJrpSj0Jpr6FTG6g7/AWBdi Vf2GGXYC2JA8urN9d6WKfT9f9a2IePB8U9bHnhT3V05O2wovG3blLfnHac49IY1lxxQY rvsGhynkfNfsvWWVSZ6ntwWtcvnyAX3nouFc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720484414; x=1721089214; h=user-agent:in-reply-to:content-transfer-encoding :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=0ik7q/PZr/sdmOUEtW0lUUBXX6ahyLieksvQYFUjpHM=; b=IKcBcDb94j4XPYJTbppYPD/z5zYLriRKU1GDgxV0ZFRAyMcH/CL28EmPVolvPeLJ3g ef2m8BR8f6ZvPNdgO9a81Va6xaLb0SS/KdiX+1vxu75melV06aVkGIoJrVBXjIvq+zrq 9g5RXR24u/jVi7YY6W1TEO9W84fFiGD1UDbCVCkLCPBbSSlydG3dqoc2hvZfM1joECRg 3Q3pedlyBDTkA9RzCBo3oVeI7+6fXxSnrwi7Z+kVtqnII/O3VTRL1PYtTidTlNqCsBrU p/aQvFlp36OFpag41b9EcfTB9uTlEOEhrR0UEt6TOPZo8KfRzJE/ZicL+nlvIn7cXHUu rgIQ== X-Forwarded-Encrypted: i=1; AJvYcCXaWZ3DrMDHPYp0dABMUuGjPN4gN1uhH6kqME+1HHncssEukE2OWkf2OPko9rutMDXsykdjzlH0Lna77dbE7BwQXZQQniSlyl35Biv2 X-Gm-Message-State: AOJu0Yy5BwwJEs7XpeOufWfvSVhqqmrRhT5bUoaSSbHX6fJm8FZ5+Cli x1/mScaj1PXaqjKgY8zae3wxeZJpVq56QHqmJzLt9TH09ZurVfk5j7kqoMzbtQ== X-Google-Smtp-Source: AGHT+IGrkU4KJcTWppNf3lYEqTVTnoMkGUazDv6x74K6Vc0nTMRFV1RrIctaNwyWOfJ0r394WssGSQ== X-Received: by 2002:a0d:fa06:0:b0:62f:aa9a:93c6 with SMTP id 00721157ae682-65917fa445bmr5231197b3.8.1720484413759; Mon, 08 Jul 2024 17:20:13 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 00721157ae682-658e4a31730sm1761737b3.6.2024.07.08.17.20.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2024 17:20:13 -0700 (PDT) Date: Mon, 8 Jul 2024 17:20:11 -0700 From: Noah Misch To: Jeff Davis Cc: Nathan Bossart , Isaac Morland , pgsql-hackers@postgresql.org Subject: Re: Faster "SET search_path" Message-ID: <20240709002011.87.nmisch@google.com> References: <20230802050720.GB866741@nathanxps13> <20230807223908.GB1284531@nathanxps13> <3b2d57ead15798adcbf6a53a15e35cdbadb2c147.camel@j-davis.com> <5bb4d9c21cc918e5d05021bf0d5e0e7d34a0377c.camel@j-davis.com> <695668acc40b937258985669f3d55b94cce82c3c.camel@j-davis.com> <20240630223047.1f.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Mon, Jul 08, 2024 at 04:39:21PM -0700, Jeff Davis wrote: > On Sun, 2024-06-30 at 15:30 -0700, Noah Misch wrote: > > You're caching the result of object_aclcheck(NamespaceRelationId, > > ...), so > > pg_auth_members changes > > Thank you for the report. > > Question: to check for changes to pg_auth_members, it seems like either > AUTHMEMROLEMEM or AUTHMEMMEMROLE work, and to use both would be > redundant. Am I missing something, or should I just pick one > arbitrarily (or by some convention)? One suffices. initialize_acl() is the only other place that invals on this catalog, so consider it a fine convention to mimic. > > and pg_database changes also need to invalidate this > > cache.  (pg_database affects the ACL_CREATE_TEMP case in > > pg_namespace_aclmask_ext() > > I am having trouble finding an actual problem with ACL_CREATE_TEMP. > search_path ACL checks are normally bypassed for the temp namespace, so > it can only happen when the actual temp namespace name (e.g. > pg_temp_NNN) is explicitly included. In that case, the mask is > ACL_USAGE, so the two branches in pg_namespace_aclmask_ext() are > equivalent, right? I don't know. > This question is not terribly important for the fix, because > invalidating for each pg_database change is still necessary as you > point out