Re: Is temporary functions feature official/supported? Found some issues with it.

From: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, mmitar(at)gmail(dot)com
Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
Date: 2019-01-02 21:55:21
Message-ID: 52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


>> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-01-02 22:18:08 Re: Is temporary functions feature official/supported? Found some issues with it.
Previous Message Tom Lane 2019-01-02 19:32:32 Re: BUG #15548: Unaccent does not remove combining diacritical characters