From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Behavior of PL/pgSQL function following drop and re-create of a table that it uses
Date: Tue, 07 Mar 2023 23:49:15 -0500
Message-ID: <121427.1678250955@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwbx=xFMedvGBk99d9dLmNhu_KNC_LwknsWV1793qjWXLw@mail.gmail.com>
References: <46DE0CE7-7E90-480D-8395-74E5309F7D26@yugabyte.com>
<CAKFQuwZrLZzoHCPc21X9PaWQPi74EUViwDjgNtgN3oM+AJfzfg@mail.gmail.com>
<ECD0AB67-C3AC-4AD3-ABD8-0BF7AAE761B7@yugabyte.com>
<CAKFQuwaihWfF9U1LvZMg3DQiXS55Rk2KA-HH1bUVPstpsdza1Q@mail.gmail.com>
<26A104A8-0B5F-421A-996E-226B4770F0BC@yugabyte.com>
<CAKFQuwbEgqCORc3MiDbeB6zRibO1Fg+19MTxNYeqDUsudYyc-w@mail.gmail.com>
<CAKFQuwbx=xFMedvGBk99d9dLmNhu_KNC_LwknsWV1793qjWXLw@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> So I found where this difference in behavior is at least explicitly noted:
>/*
> * If it's a named composite type (or domain over one), find the typcache
> * entry and record the current tupdesc ID, so we can detect changes
> * (including drops). We don't currently support on-the-fly replacement
> * of non-composite types, else we might want to do this for them too.
> */
I'm not quite sure that that's related, really. That code is concerned
with detecting changes to an already-identified type (that is, type
OID NNN has different details now than it did before). It seemed to
me that Bryn's question was more about reacting to cases where a given
string of source code would resolve to a different type OID than it
did a moment ago. We don't have a great story on that, I'll agree.
You can get into that sort of problem without anywhere near the amount
of complexity embodied in this example --- for instance, I'm pretty
sure we don't re-parse type references just because somebody else
executed an ALTER TYPE RENAME somewhere.
regards, tom lane
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, bryn@yugabyte.com
Subject: Re: Behavior of PL/pgSQL function following drop and re-create of a table that it uses
In-Reply-To: <121427.1678250955@sss.pgh.pa.us>
References: <46DE0CE7-7E90-480D-8395-74E5309F7D26@yugabyte.com> <CAKFQuwZrLZzoHCPc21X9PaWQPi74EUViwDjgNtgN3oM+AJfzfg@mail.gmail.com> <ECD0AB67-C3AC-4AD3-ABD8-0BF7AAE761B7@yugabyte.com> <CAKFQuwaihWfF9U1LvZMg3DQiXS55Rk2KA-HH1bUVPstpsdza1Q@mail.gmail.com> <26A104A8-0B5F-421A-996E-226B4770F0BC@yugabyte.com> <CAKFQuwbEgqCORc3MiDbeB6zRibO1Fg+19MTxNYeqDUsudYyc-w@mail.gmail.com> <CAKFQuwbx=xFMedvGBk99d9dLmNhu_KNC_LwknsWV1793qjWXLw@mail.gmail.com> <121427.1678250955@sss.pgh.pa.us>
* 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