Re: Forbid to DROP temp tables of other sessions
Daniil Davydov <3danissimo@gmail.com>
From: Daniil Davydov <3danissimo@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Steven Niu <niushiji@gmail.com>,
"Andrey M. Borodin" <x4mmm@yandex-team.ru>, Andres Freund <andres@anarazel.de>, Thomas Munro <thomas.munro@gmail.com>, Rafia Sabih <rafia.pghackers@gmail.com>,
Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-03-17T17:58:45Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pg_basebackup: Add missing PQclear in error path
- a19db0827496 18.0 landed
Attachments
- v4-0001-Fix-accessing-other-sessions-temp-tables.patch (text/x-patch) patch v4-0001
Hi, On Mon, Mar 17, 2025 at 10:09 PM David G. Johnston <david.g.johnston@gmail.com> wrote: > > On Monday, March 17, 2025, Daniil Davydov <3danissimo@gmail.com> wrote: >> >> >> > >> > 2."you have not any temporary relations" --> "you have no any temporary >> > relations" >> I am not an English speaker, but it seems that "have not" would be >> more correct. Someone has to judge us :) >> > > Both are not good. > > “pg_temp was specified but it contains no relations” [1] That sounds reasonable. I'll fix it. Thanks! > But why are we promoting this situation to an error? It should be a relation not found error just like any other and not its own special case. > The fact we create pg_temp only as it is needed is an implementation detail that should not be visible to the user. 1) Error message has no mention of a non-existent schema. "Schema has no relations" => "Given relation not found in empty schema". It seems to me that these are equivalent statements. 2) Is this really the implementation detail that we want to hide from the user? User can just run "select pg_my_temp_schema();" and see that there is no temp schema in the current session. Don't get me wrong - I can agree with that, but for now it seems odd to me... Steven Niu also mentioned this issue, but IMO we must give the most accurate description of the problem - tell "relation not found" only if we have temp namespace, but not specified relation in it. Please see v4 patch (only comment change). -- Best regards, Daniil Davydov