>> 1) all other sessions being unable to create a temporary table until the
>> prepared transaction is finished (reproducible);
> Locking issue perhaps?
For sure.
session1:
l=> begin;
BEGIN
l=> create function pg_temp.foo() returns void as $$ begin end; $$
language plpgsql;
CREATE FUNCTION
l=> prepare transaction 'z';
PREPARE TRANSACTION
l=> \q
session2:
l=> create temp table t();
^CCancel request sent
... blabla when inserting (0,15) into "pg_namespace_nspname_index" ...
(sorry, server was running in non-english locale)
reprocuced in master and in 10.5
> It's not a bug if a prepared transaction
> is holding a lock.
The weird thing is the lock comes on namespace level locking against
creating any temporary object.
It isn't the case for without prepared transactions, neither can it be
achieved with CREATE TEMP TABLE only with no functions involved.
>> 2) data corruption in pg_namespace, server crash (happened a few times,
>> but I'm not yet sure how to reproduce).
> That would be interesting.
I cannot reproduce it on 10.5.
Will try on master later and get back to you if I have any luck.
Best,
Alex