Unique namespace per session for temp tables? - Mailing list pgsql-hackers

From Emmanuel Cecchet
Subject Unique namespace per session for temp tables?
Date
Msg-id 4A29A4EE.3030002@asterdata.com
Whole thread Raw
Responses Re: Unique namespace per session for temp tables?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi all,<br /><br /> Following the issue with temp tables and 2PC, we thought that each session in Postgres was
supposedto generate a unique namespace for its temporary tables.<br /> But if we execute the following scenario:<br
/><strong><br/> First session</strong>. <br /> BEGIN; <br /> CREATE TEMP TABLE foo (x int) ON COMMIT DROP; <br />
PREPARETRANSACTION 't1'; <br /><strong>Disconnect</strong>. <br /><strong>Wait</strong> (at least until backend process
forfirst session exits). <br /><strong>Reconnect new session</strong>. <br /> CREATE TEMP TABLE foo (x int); <--
blocksuntil t1 commits <br /><br /> The issue we see is that a totally unrelated session (which should have a unique
temporaryschema), reuses the temporary schema that is locked away in the prepared transaction. Isn't that breaking the
assumptionthat each session should have a unique schema for its temp tables?<br /><br /> Thanks in advance for your
insights.<br/> Emmanuel<br /><pre class="moz-signature" cols="72">-- 
 
Emmanuel Cecchet
Aster Data Systems
Web: <a class="moz-txt-link-freetext" href="http://www.asterdata.com">http://www.asterdata.com</a>
</pre>

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.4b2 tsearch2 strange error
Next
From: Tom Lane
Date:
Subject: Re: Unique namespace per session for temp tables?