Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geoTv-0005lt-0z for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jan 2019 21:55:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1geoTt-0005x2-P1 for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jan 2019 21:55:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geoTr-0005rA-Q9 for pgsql-bugs@lists.postgresql.org; Wed, 02 Jan 2019 21:55:17 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geoTo-0006K2-FX for pgsql-bugs@postgresql.org; Wed, 02 Jan 2019 21:55:14 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 7EB46221BC; Wed, 2 Jan 2019 16:55:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 02 Jan 2019 16:55:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imap.cc; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=9 q1/2ISnCgvYkvDZ60lG3tO0G3Gu0iIn16KEg5zpDGg=; b=p4woYlE+78On71SYY D1mcYKPhu7JOsGEEa/57igKe1UzqkWM8kbr3iUqauKxfanNKs9qlrEtipnzmzpLk 2eWcQ2dtc+o3jo0VQBwTBDKUi8BpVbnKb3ErL0CAiwASNekEnQcPDFgmTPQVzvam KPVprGrvWanoQcbko1Pn6pxlUpAk8TZ7cPEfuncTw1S9dEh8agQ/R/OYr9e12WE1 WM2SUTnwvm3Wht/PuSFMc+RJzBbW6w2Edh14zOZFybzikDUUAwPeyIKmfAvfqTct oV6+nW76/r9MTaxgOtmYF1YUvEJ9n8xIAezIftH5+QoYcAvmZ39iGaJErLrJ5Syu SLfTA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=9q1/2ISnCgvYkvDZ60lG3tO0G3Gu0iIn16KEg5zpD Gg=; b=w9VCwtBLpmcVCaFYbSymgOEMk6IzXs1arrTTmHlYhHJmCIViTW1zhrVk6 rZ6UBp71JMwAavWaE8TZxuUXfLduy81xuinSbVAtMdRy4umSPT1u4zOGNZOFqNrw EczMBiQmSCTyko/dwuJ2p48UkAKY9j0d0tP/b10pm/5ks6AA7a4GPXszoBq9c/Bu CjgbuVLQY+CW405xOFcoePTtQmnha7v9hzmHixpBkxcyURSp3V0LcjbpyGD3nb4F pPjeIeX52meJZl/wVMFRQXuxWnY4ed4+iW4BXf3v5WmoMM4U9tD6al31HeAaiVcG iBmrhccL8bJNnXI+xMt6kzJbts9fA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrudeigddugeelucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdeftddmnecujfgurhepuf fvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptehlvgigvgihuceurghs hhhtrghnohhvuceosggrshhhthgrnhhovhesihhmrghprdgttgeqnecukfhppeekiedrvd dtrdeffedrudehudenucfrrghrrghmpehmrghilhhfrhhomhepsggrshhhthgrnhhovhes ihhmrghprdgttgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.0.10] (cpc83287-brig21-2-0-cust406.3-3.cable.virginm.net [86.20.33.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 6F6B0100BB; Wed, 2 Jan 2019 16:55:10 -0500 (EST) Subject: Re: Is temporary functions feature official/supported? Found some issues with it. To: Tom Lane Cc: pgsql-bugs@postgresql.org, mmitar@gmail.com References: <5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc> <22938.1546456949@sss.pgh.pa.us> From: Alexey Bashtanov Message-ID: <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc> Date: Wed, 2 Jan 2019 21:55:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <22938.1546456949@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >> 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