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 1wEuvE-004Yls-0c for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 20:08:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wEuuC-004QG5-2u for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 20:07:40 +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 1wEuuC-004QFx-1f for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 20:07:40 +0000 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wEuu9-00000002BU7-44ma for pgsql-hackers@postgresql.org; Mon, 20 Apr 2026 20:07:39 +0000 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-7dbec19732eso3228531a34.3 for ; Mon, 20 Apr 2026 13:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776715656; cv=none; d=google.com; s=arc-20240605; b=ZoOMkT/eosA3XjFeArHHidS8pHr8i+x1i8DPuCTGeqinYheyt07IBnOI9GWIsJOQXb qKljSq3VkDu4eYwesSypLd8Ut3R22yi/FVb+OtS9On0JsTLuE7drBKSJaOooLV/BYPV3 DWrVltJUf0NZTnJtwxbkngwIiTvtEGgf+NM4ZMR8QykpCDxC3isc8jY3ARwslA1zW6PP VnjDbzhEXqBzKxS1JbkEXq43PvaEp4PUnBNz1RAZeIqLobVx9+7PxFDMCw+8dSIAitgP /F9DSj0xm9s596bhtE/0s4K/cMYtaY8hruLTwci1lS79WdCGkmzmthy8SE/KGWJD79qK 7pVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=knKzZinDpjzMlLnTv+Y2RH59wW3ketLZ8TW6m6qeAaw=; fh=2LuSFfU0T92aiMAG1tPpUe+QxETfHef26+v+45vJSe4=; b=OkSWnKHAOXP2LTfnBmh1qJb47AsGp8SAk68+aJ1Tx2rj/ymH6fO2OjBZuc+6rrWZsR XsE5yz9Z7CNtTuEb7DLOtZ78CJf5om2yHr5OII3hqQkNcj5bOwSvBqDMsZV/6XkC22Bs vhYyQLGFNB3tN7kC5OEw9RUpOCGf2vPBZH2S98dWkZI9Kmk8Ds4gnWntKDIPSwhMHYxd 8mj8uoCdUBKLtuwti5Jcx82lhlp9U7FF9fOLjK2RXU2gHhBkuzMvIW6eMtOHK7c1CVZz y7H9LlnXQSJ0EcT5tmM/XCeadJP9+a0tpOPwC0+gzzZbf7TeAfRFLObocpbz7jwerLQh T1Zg==; darn=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=1776715656; x=1777320456; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=knKzZinDpjzMlLnTv+Y2RH59wW3ketLZ8TW6m6qeAaw=; b=D9DSae8B+XkHoJJGHPQoZoPHcWkoEkYZvZowTj2+BIn/3JVTBNY+pKdq5YrncWJfB5 of80++39Omea9whmBWRKqZBhAPC34zfhzYR/XiY24ZKgjiHLJ+1ZL61DV0lUe0RxBB21 OhdWEVycA3iJAd397DTNMhd1rLNkY1W0GnWJSxQELYrqrZ9Kl9lEeVv3ezVkVSVkRnDy Chnl2OgKBTGzgi9fFX7Hl+8E2uMlKNqFhEEf+rDCRpEGtkyCzkYj4C5O92IIXacr5s/O Tt0awXnS2BhLNV775cJeO5GzDKOVRL4Rx9l5xgWA6rP6nsMSU8QpjxDSHo1KMhiiVj0r 8DAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776715656; x=1777320456; h=content-transfer-encoding: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; bh=knKzZinDpjzMlLnTv+Y2RH59wW3ketLZ8TW6m6qeAaw=; b=I9l21X+D3i+Jq4jS/cVb5h6wObjvItGh+NWxxXDcPvbUOfEe66PFUAbj9R3glnE9wC cB0ldGFbEwwrwT1YkIYkxxOsEFQLQYACpVojn4RoC+2PVtbyRzRON033oFBduFNugFGp lQ4HVPCX7rEZitOrsYVU6bQtjOEUkudnF9v20rcmUg/w4qvidRJF/4y5TVh8T/tfxMM6 zA9bJkKHpvIAVtragwEHMDi3WBIhWKKKI2Op7LqtuCcyrl0lgjfvbpZCNGpygkQFX3M7 Bd5qxVGry4uur8zC8HVaOWylFpocduTKhoFFRDIo61325sx/WZIlzSszfwuG56p/zu0Q fI9Q== X-Forwarded-Encrypted: i=1; AFNElJ9ZX5kUtwiL0MsUhq3R3kuhU6YuKkk5Ym4DrOScrnTKertz1ybhe2y7XFy1Y9wVs00iFQhw2zWQrHvGw2rz@postgresql.org X-Gm-Message-State: AOJu0YyRYLqZG2d/zfvZZNWHezTzi3dBsowyJA+SslxTFNEKSBa06wP7 q5WkT92a8EBj4yP/tG5lQsFA4Q80ojgPV79p3+NViO1uANqB8Jh13T6RlYjeKxTTxf86IZKGeZK c89+2gFSrR/PhJ/bHCZZZvpvdF1KR4x0= X-Gm-Gg: AeBDieveDlkZJLeL+utMXt2jo5WaBUIrtr5uFu6umtH370VK3vzziY3rvkp6zSb7MWP UXBDSj++KojuwtGL1tqy0bknwT9863GjHrVV28tjfKZA8RPWCgSweZtmjaWvm6xJ+ojewMagnog 3Md+JzLzgDqIUcgjf8dNjunuZU6vT79cHYmmjmdUvOu0knYBRHusHA2a9XWq9d8BC8jaLE6s/r4 r26TC749Nd/Ex9lYWSt0JtIDDB8qZ+Vu8AhJ7azXqXfzcJ90HkhPAWnqLK2S2iF2zJ5nk+m3PAx EUiBzT70l3N9Pgh0JDYnSvmx/lXysQL7r7/SypE6RepKNgr41d4uawxLm/wsECE1tAETUkhYkDh OngKWjgiYEV5de8gi X-Received: by 2002:a05:6820:3397:20b0:684:75f4:230d with SMTP id 006d021491bc7-69462dffcf5mr5757630eaf.11.1776715655650; Mon, 20 Apr 2026 13:07:35 -0700 (PDT) MIME-Version: 1.0 References: <1a32fc83-df78-4774-97dc-2bb06dbb16e9@uni-muenster.de> <3529398.1774273446@sss.pgh.pa.us> <4075754.1774378690@sss.pgh.pa.us> <67637cf8-8cbf-4f86-8775-52aa0329972d@uni-muenster.de> <402bbc8d-728b-4467-8024-31c2bc101ead@uni-muenster.de> In-Reply-To: From: Alexander Korotkov Date: Mon, 20 Apr 2026 23:07:23 +0300 X-Gm-Features: AQROBzCs-w2g9fMAqLhYHFsWOQnIMt4yXwpUG-UknYQzdsPuEpUS72VrLAQF6Bo Message-ID: Subject: Re: Fix bug with accessing to temporary tables of other sessions To: Soumya S Murali Cc: Jim Jones , Daniil Davydov <3danissimo@gmail.com>, Tom Lane , Stepan Neretin , PostgreSQL Hackers 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 Hi! I've checked the thread. Thanks to all the participants for their work. I think there is a general agreement on the design. On Thu, Apr 16, 2026 at 9:41=E2=80=AFAM Soumya S Murali wrote: > Thank you for the guidance and the updated patch. > > On Mon, Apr 13, 2026 at 7:26=E2=80=AFPM Jim Jones wrote: > > > > Hi > > > > On 13/04/2026 14:40, Soumya S Murali wrote: > > > Please let me know if there are additional scenarios I should > > > validate. Looking forward to more feedback. > > > > Thanks for testing it. You can take a look at > > 012_temp_obj_multisession.pl and check if we missed any path. > > > > Due to changes introduced in b2a17ba7a5d the patch was no longer > > applying. See rebased v18 attached. > > > > > I tested the rebased v18 patch on a clean tree and verified that it > applies cleanly and behaves consistently with previous results. > Cross-session access is correctly blocked with: ERROR: cannot access > temporary relations of other sessions > Index scan paths are also properly restricted, and same-session access > continues to work as expected. > The updated test changes look good. Everything works as expected, +1 > from my side. I see the patch changes the error wording. Previously the error was "cannot access temporary tables of other sessions", but we change it to "cannot access temporary relation of other sessions". I see the intention here: we trigger an error while accessing some relation (not necessarily a table) then we should reflect this directly to the error message. However, old message is already here for quite a while and translated into many languages. Also, is old message incorrect? We trigger an error on buffer access. That is, we trigger an error only for relation with a storage: table, index, sequence or matview. Matview can't be temporary. Also, if you access an index with a query, that means you're querying its table. But sequence can be temporary and it can be not directly associated with a table. So, yes, new error message is more correct. But I would prefer to make it a separate patch, and replace all the occurrences including contrib. ------ Regards, Alexander Korotkov Supabase