pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexey Bashtanov <bashtanov@imap.cc>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Cc: mmitar@gmail.com
Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
Date: Wed, 2 Jan 2019 21:55:21 +0000
Message-ID: <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc> (raw)
In-Reply-To: <22938.1546456949@sss.pgh.pa.us>
References: <5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc>
	<22938.1546456949@sss.pgh.pa.us>


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






view thread (22+ messages)  latest in thread

Message-ID: <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc>
Permalink:  ../52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc/
Also on:    postgresql.org/message-id/52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bashtanov@imap.cc, tgl@sss.pgh.pa.us, mmitar@gmail.com
  Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
  In-Reply-To: <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc>
  References: <5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc> <22938.1546456949@sss.pgh.pa.us> <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox