Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZljv-0002h9-41 for pgsql-general@arkaria.postgresql.org; Wed, 08 Mar 2023 04:49:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pZljt-0002yU-Tt for pgsql-general@arkaria.postgresql.org; Wed, 08 Mar 2023 04:49:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZljt-0002yL-Iy for pgsql-general@lists.postgresql.org; Wed, 08 Mar 2023 04:49:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZljq-00073E-TD for pgsql-general@lists.postgresql.org; Wed, 08 Mar 2023 04:49:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3284nFKr121428; Tue, 7 Mar 2023 23:49:15 -0500 From: Tom Lane To: "David G. Johnston" cc: Bryn Llewellyn , pgsql-general list Subject: Re: Behavior of PL/pgSQL function following drop and re-create of a table that it uses In-reply-to: References: <46DE0CE7-7E90-480D-8395-74E5309F7D26@yugabyte.com> <26A104A8-0B5F-421A-996E-226B4770F0BC@yugabyte.com> Comments: In-reply-to "David G. Johnston" message dated "Tue, 07 Mar 2023 21:25:01 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <121426.1678250955.1@sss.pgh.pa.us> Date: Tue, 07 Mar 2023 23:49:15 -0500 Message-ID: <121427.1678250955@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" 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