Re: [Proposal] Global temporary tables
Wenjing Zeng <wjzeng2012@gmail.com>
From: wenjing zeng <wjzeng2012@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Prabhat Sahu <prabhat.sahu@enterprisedb.com>,
tushar <tushar.ahuja@enterprisedb.com>,
Robert Haas <robertmhaas@gmail.com>,
Tomas Vondra <tomas.vondra@2ndquadrant.com>,
Konstantin Knizhnik <k.knizhnik@postgrespro.ru>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-07-30T12:09:36Z
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 →
-
PageAddItemExtended(): Add LP_UNUSED assertion.
- 30aaab26e521 14.0 cited
-
Remove temporary files after backend crash
- cd91de0d1795 14.0 cited
-
Fix comment in indexing.c
- 9fd2952cf492 14.0 cited
-
Fix failure to ignore leftover temp tables after a server crash.
- 6919b7e32947 9.3.0 cited
> 2020年7月23日 下午2:54,Pavel Stehule <pavel.stehule@gmail.com> 写道: > > >> I am thinking about explicit LOCK statements. Some applications use explicit locking from some reasons - typically as protection against race conditions. >> >> But on GTT race conditions are not possible. So my question is - does the exclusive lock on GTT protection other sessions do insert into their own instances of the same GTT? > In my opinion, with a GTT, always work on the private data of the session, > there is no need to do anything by holding the lock, so the lock statement should do nothing (The same is true for ORACLE GTT) > > What do you think? > >> >> What is a level where table locks are active? shared part of GTT or session instance part of GTT? > I don't quite understand what you mean, could you explain it a little bit? > > It is about perspective, how we should see GTT tables. GTT table is a mix of two concepts - session private (data), and session shared (catalog). And hypothetically we can place locks to the private part (no effect) or shared part (usual effect how we know it). But can has sense, and both have an advantage and disadvantage. I afraid little bit about behaviour of stupid ORM systems - but the most important part of table are data - and then I prefer empty lock implementation for GTT. This is empty lock implementation for GTT. Please continue to review the code. Thanks Wenjing > > Regards > > Pavel > > > > > > Wenjing > > > >> >> >> >> >> >> Wenjing >> >> >>> >>> Now, table locks are implemented on a global level. So exclusive lock on GTT in one session block insertion on the second session. Is it expected behaviour? It is safe, but maybe it is too strict. >>> >>> We should define what table lock is meaning on GTT. >>> >>> Regards >>> >>> Pavel >>> >>> Pavel >>> >>> >>>> With Regards, >>>> Prabhat Kumar Sahu >>>> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/> >>> >>> >> >