From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexey Bashtanov <bashtanov@imap.cc>
Cc: pgsql-bugs@postgresql.org
Cc: mmitar@gmail.com
Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
Date: Sat, 5 Jan 2019 09:00:37 +0900
Message-ID: <20190105000037.GA1626@paquier.xyz> (raw)
In-Reply-To: <9176.1546613679@sss.pgh.pa.us>
References: <5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc>
<22938.1546456949@sss.pgh.pa.us>
<52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc>
<10857.1546467488@sss.pgh.pa.us>
<20190104131351.GF2067@paquier.xyz>
<9176.1546613679@sss.pgh.pa.us>
On Fri, Jan 04, 2019 at 09:54:39AM -0500, Tom Lane wrote:
> Hm, I had forgotten that we had such an error message. Really that
> restriction needs to apply to any object in the temp namespace, not only
> tables.
The cleanest way I can think we need to set up the flag each time
InitTempTableNamespace() *could* be called. If myTempNamespace is
valid, the routine may however not be called. So an idea is to return
immediately from InitTempTableNamespace() if myTempNamespace is valid
instead, which would mean removing its assertion at the top. Using a
wrapper on top of InitTempTableNamespace() is also possible but I
think that we should design things so as only one code path sets
MyXactFlags, and one good thing is that InitTempTableNamespace() is
the only code path setting myTempNamespace.
For the tests, it is possible to use "\c -" to enforce a reconnection
which would be able to discard the previous temp namespace and allow
reproducibility, however as this problem applies to any objects which
can be schema-qualified this is not necessary for all the tests.
I think I can get that worked out with a back-patchable approach,
still it looks a bit sensitive because of the creation-pending logic
which relies on the assertion at the top of InitTempTableNamespace,
which is a case we may want to handle with an extra flag for the
caller of InitTempTableNamespace(), aka "fail if myTempNamespace is
valid instead of just returning back".
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, tgl@sss.pgh.pa.us, bashtanov@imap.cc, mmitar@gmail.com
Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
In-Reply-To: <20190105000037.GA1626@paquier.xyz>
References: <5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc> <22938.1546456949@sss.pgh.pa.us> <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc> <10857.1546467488@sss.pgh.pa.us> <20190104131351.GF2067@paquier.xyz> <9176.1546613679@sss.pgh.pa.us> <20190105000037.GA1626@paquier.xyz>
* 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