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 1gepOt-0000cv-Co for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jan 2019 22:54:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gepOs-0006wB-3s for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jan 2019 22:54:10 +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 1gepOr-0006w4-QB for pgsql-bugs@lists.postgresql.org; Wed, 02 Jan 2019 22:54:09 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gepOo-0007ds-VT for pgsql-bugs@postgresql.org; Wed, 02 Jan 2019 22:54:08 +0000 Received: by mail-qt1-x844.google.com with SMTP id v11so35181740qtc.2 for ; Wed, 02 Jan 2019 14:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=bPZwk+AjvhgkYe+D3KR5fOf1nIXz2luYTgrGbWgrJXI=; b=SyCEgsxEYlPDvxzYuyI6CzsMERKIXhvqwGwo7HuqgbIlDbEIPBWN/WZm7wAmh1ZdQR Pj9UiVMK+4y31TJDi6jLqMbDrbzrCytvj++P9+vY5PnRKCRFEkvxWRYYGHjzhl8b9XlE /0JAC2SFNqlQf1C3N/jF4ezu/oxVpo1LWYngnqgZXLjW7CWlx/Utpy8J6tZmvjlPMW2O zBr5uwRMRkxeN1tLwUvcfRfYC7xY4VwgeIBhMf1L+INL+TQUIizVPMWYSj5zyxoS3dJP sC+Itrb8l+BCN/uzA0Sa3UfHJVXVEWEp9mAldWzfNPHK3FIlOHMNXUl6AVxrR0znhIUv /YSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=bPZwk+AjvhgkYe+D3KR5fOf1nIXz2luYTgrGbWgrJXI=; b=GxPrrTyqlbdvCIzbZUbY8/CyS1Kn7k0zWREcAoEtj9H3RGWREU9Kwh/ADSKVxE+gpD Ur069xg3RlXbnv4ovUrO3BsM2B1VKx/oA6ENOsQ07qSQHe7e3j+HB7lmaSBUJnpC4jzc 2mvqaNxi6bKrkcnJKks5ArhoplfPp1p+X6SCOFRuK38hV6U+yRy08HCiwi1bmHKhFpkJ 9wmYb3cQUP48/ie7/0zyNxfJI4v+Rbmf2SOOIeVoZZL+ZnLAMRi24k7f7D2ZgrmXp3sE GvyMtgqYNtTc/hqLlV7QUgBnKvYX85/EB5wDa8iWWvinhwAxjRDDeGC6Vom0QiXs7agD iqtQ== X-Gm-Message-State: AA+aEWYvImb/Hw0ShEZbyWOpzA0li/6dKsH23kQwKYgF7vfL+qwRM6EK dx9L0gzZ7pd1DId1GHhuUMBhYA== X-Google-Smtp-Source: ALg8bN6qq9LoG7FSoYZGGANycWqJWEHbzjnfhAbL81Sx6Rh0wrK9uEkbXtn38nDs6PkQLsUAd18KOw== X-Received: by 2002:aed:36c1:: with SMTP id f59mr43820126qtb.250.1546469646205; Wed, 02 Jan 2019 14:54:06 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id 189sm22106505qkh.9.2019.01.02.14.54.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Jan 2019 14:54:05 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id CB859A2F; Wed, 2 Jan 2019 19:54:03 -0300 (-03) Date: Wed, 2 Jan 2019 19:54:03 -0300 From: Alvaro Herrera To: Tom Lane Cc: Alexey Bashtanov , pgsql-bugs@postgresql.org, mmitar@gmail.com, Dimitri Fontaine Subject: Re: Is temporary functions feature official/supported? Found some issues with it. Message-ID: <201901022254.i2tq35ybw75n@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <10857.1546467488@sss.pgh.pa.us> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-02, Tom Lane wrote: > Maybe we ought to forbid prepared transactions from creating (or > deleting?) any temp objects. I seem to remember that we already > made some restrictions of that sort, but they clearly weren't > sufficient to prevent all problems. We make that check at transaction prepare time, but obviously there's no way to do it any earlier since we don't know ahead of time whether the transaction is going to do the normal commit/abort or become prepared. Moreover, Dimitri has recently posted a patch[1] allowing prepared transactions to commit if their temp tables are ON COMMIT DROP, which conflicts with this approach. This seems problematic if the pg_temp_NN entry is reused. Maybe we should make temp namespace names more unique if we want to add extra features :-( [1] https://postgr.es/m/m2d0pllvqy.fsf@dimitris-macbook-pro.home -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services