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 1wF3uh-004i0r-2s for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2026 05:44:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wF3uh-006U0k-0R for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2026 05:44:47 +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 1wF3ug-006U0c-2a for pgsql-hackers@lists.postgresql.org; Tue, 21 Apr 2026 05:44:46 +0000 Received: from mail-dl1-x122e.google.com ([2607:f8b0:4864:20::122e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wF3ue-00000002FUh-2m6X for pgsql-hackers@postgresql.org; Tue, 21 Apr 2026 05:44:46 +0000 Received: by mail-dl1-x122e.google.com with SMTP id a92af1059eb24-12c637089ccso9176876c88.1 for ; Mon, 20 Apr 2026 22:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776750282; cv=none; d=google.com; s=arc-20240605; b=BX4ZqaEBgiwnLOjIvrM6WgEcqQ5ighP5H2cIYhYF6KSDouhfZ3lXjORWF2yBhmHJnG /lWd3QsQzLA30vPTr5edogelw7YNJDNFPr9dpViKoBQAPl08oliYmu0KvSZ/QHWX9zbL wkOcYBttf8CT+y1RtJerLSq7G8M6hL0kTYplMXIeTf1Kr2chVcvRYJ/wi6sa6WCVGJAB Ekg1TVioU0q4M//1XzCTxox5lxRCN/0t6e953nXFJOFG5lt1r7jyEpramBqPJFtrusQB QcL8RbeI/gcy9dwnGli3jTRL+XNUp3P67ypY9fgZX+hpRxiRhbP+wXkNiBXGufr/2/77 uHFQ== 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=/HDirIAP8B+0ActJ26HN+pjvp4UCgKaZdgAIaQPjd1c=; fh=PFrSo1W69tF8qJcVM3qiAHEK2mSH/4LJIvZ+B7bUz8k=; b=NvselPcdKb2WNuPTT3rwTbka2YUbFIllknYs+Ps1wfsvjtWdGYcJ1TIjYY6v19udV7 9a2rm1bV9X6xv85exNPWD1MOY0SsYUbW+DyP/sDfrGyzMdaS4l7owe9OAyWZrRm3yYIP Nc7TKTPjO3UyoUx7XbceDNtRBIKXZXXgBdrfy0UHH9VOMoy7C0wguFQE2+RGCgwFHFQA awMtcxn8KKHPxjLVf0ibwWcAttVBMBfihhjGAjXk1QOmveCCt4YPo2XtCOANkK4X1PjV 3ghDvVAYvJoOpnSKfPFETZEw6cXgKA8xSxPGd2xdSQzkkicBNXPCFJQhBVAnB8dT4T4e VPHw==; 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=1776750282; x=1777355082; 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=/HDirIAP8B+0ActJ26HN+pjvp4UCgKaZdgAIaQPjd1c=; b=KC9BSH8Uz0e6N67106PwyP9OR/aPrQJeMjBCw55AtgRj2RiJM7g3XfjFuc9FEdb94L +vWJNmCnNgZoAqbnUAvZfj63y3yYg8Tl7pZ1yFmm4amPkKp2hjJEY0u21/Fxtl5vk380 shYk+5u9k6COFxeozBLQBjTS0xAU9STkb0TwsZpya1JzlcwqwUBqxPXQrtX1QxHqMizG P5CUuc94UuOsmkEL9K11k7nNQOCMMrKo1iuLlcvdm8lgftetDUW5bL/dMrgjz+AOFhxJ k8PT/cA6JSoT9Y5UMMRbrkcNV8d5gNlU3t14jDbKNqplgrtU7BOmH/Ye1RHfREF8Ls/h isbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776750282; x=1777355082; 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=/HDirIAP8B+0ActJ26HN+pjvp4UCgKaZdgAIaQPjd1c=; b=Aej8eX4tUE7F/XTQT/gdrsAhSMJlpmTlfXLYCVYDjNQvHblj9dZwqX1hvzacagpJI/ ZeEZlYhF6YQc2RYROH06ynrTeTZnMyosKzdHQJwOvInGGzlF/YqzHlxHXE7qvfP0ZYEt ExczpXsSsHip65gXmqotqEEnU7g9QogJ3pyHm1mxNgRpd9XvThMnnv99lwdrrc6ScvFI mtyaLuJsizMtnTRqKkWtrO1BLydEQVo9nwMYi6MexBYqU4oMLHvM8F+OPwH8DuYF3fWK FE47kZYHrbhNY2ZrrB+9YVeCgbsDN9weH1QCha4zUvT5Olts7Cn8dlYRwPFvOUCj11YA ClMw== X-Forwarded-Encrypted: i=1; AFNElJ+yW0QeMcy1yr65sYAHgIsAqlscZQb/QgLhmjfC3yJ6vVnO4QXGZLBxIbMzI33STgzxeMrYvXHcaNV+dWOq@postgresql.org X-Gm-Message-State: AOJu0YwVd15dQpf2sQeuys489tFZZKrCkfy+YloKLlwHT+FYxcKh6PF3 SpcYBmkaaKsJLJ+b5aROtRpBD/2O/lWW7Ux7h+mN+BIyKWFW6gIpqKS+0Iy/rBas+ksVXIeBknu bqsgLGyQQzOCXru9IyugTA6MbONSrshE= X-Gm-Gg: AeBDieshyKzs/5/98fsycEK98K9l4JeCAnbhN+WboqL+y8E44ZFCD/kNWxzmG/eZxsq 6jewN9eg7M11MKjX+7d/MXXYb9wC0/4TDOrvn1xgVl9qM2DquI2rQiTvFLqFNimVSV4pvEynKVW DerDNKMJ/f4PXbqvFymeJI26+s+DrlVM/c01mSHELP/vO6UUViZMuvlT/urC7L3JxLAKxCEKIL7 5yh0v9j1ue6ZF8cQK/zz6D/YiSkXJMKmasQfoSCSA1qs+lK0r8YjlqDGthp4wsVIR65nW8NZhAe SaC1pPFgQTydfA0LTA== X-Received: by 2002:a05:7022:fe08:b0:11e:161:c008 with SMTP id a92af1059eb24-12c73f9a782mr10083594c88.26.1776750281586; Mon, 20 Apr 2026 22:44:41 -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: Soumya S Murali Date: Tue, 21 Apr 2026 11:15:06 +0530 X-Gm-Features: AQROBzBJJVw7gigHbW5xmfnMejR_m5h2Bvwq-6ogNT-KK2Q9yZzQ1Vm66SJf52o Message-ID: Subject: Re: Fix bug with accessing to temporary tables of other sessions To: Alexander Korotkov 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 all, Thank you for reviewing the patch and for the detailed explanation. On Tue, Apr 21, 2026 at 1:37=E2=80=AFAM Alexander Korotkov wrote: > > 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. > This makes sense. While the new wording is indeed more precise, I agree that changing an existing error message, especially one that has been present for a long time and is already translated, should be handled separately from the bug fix. Keeping the current message for this patch and addressing wording improvements in a dedicated follow-up patch sounds like the right approach. Thanks for pointing this out. Regards, Soumya