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 1palKY-0004V9-HO for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2023 22:35:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1palKW-0006t3-OI for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2023 22:35:16 +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 1palKW-0006st-BE for pgsql-hackers@lists.postgresql.org; Fri, 10 Mar 2023 22:35:16 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1palKT-0004ij-9C for pgsql-hackers@lists.postgresql.org; Fri, 10 Mar 2023 22:35:15 +0000 Received: by mail-qt1-x82e.google.com with SMTP id l13so7499946qtv.3 for ; Fri, 10 Mar 2023 14:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pcorp-us.20210112.gappssmtp.com; s=20210112; t=1678487711; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=y7kYEuKSXwaLb22Q0yh26Yt44/ikPBLyvH3mOHG+yvc=; b=UcGxP0zSrfOPedWQjRFHUJMDcDkA73XfcdFFyYdOxnf5NNoaaaqur3buz2pjvdfyHK Zd+kXCZh9yacc9ofpKdI2HQ1dhNko7pMI+jfyk2b6ovzkkE0OrlIhVJ7/UqRNUI1qBiG iwsMTLCT6Nz37DhXRc6PQpSWjbBc5e/iwggfj1wy8Sx7Zbv2hTF+UdIm4fIPyBt/BsvW 8MusSM+DzsgQ41RdS0oD5LX5Z0TVlJavXoPdZe4uERYlxGYgk2xVdWzQlWS714n6rHAu +hUpNF1hp6iH/18I6uh4buFJwmBpYk/WfDjqyp9jdstPq/ueHcRCkNzvSOgZJq2fdO+V oaYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678487711; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y7kYEuKSXwaLb22Q0yh26Yt44/ikPBLyvH3mOHG+yvc=; b=jM04vbGnq2d2dvi6rQ1JDtMbZGX1QhyWk5/FzdXJOCsk36a/s67KUkOhKZqBb/7m0Z 1KJIXtAynWK2EyJD/+a+/dw9wEBqbJlfyHpSTVPBb2cDacAwr0gSXYi5uYykNiAX6Ez4 or9Za73Y+skWmSfWfz2vGQKluzuYObtNfLg1YP11BC9sCqqD+Ceh7XIyiHv8ySFbQxh/ lNBd40L24HvfjmyWFv42TtDUT8vN1Qv2JskQmQbG491+8BZ5qvt/aku2GSGGIuC2LVK9 qKuUUNWry35WKJLtSrdLXU8A7R4eE+1WrjWo7ykigmxEfxBJFwsZUlIzpxt1AoXGmAGY 1eig== X-Gm-Message-State: AO0yUKVOYfUl8VHsjKOUQ8oFU8lYk69Gww1omKokHCjW1FOp0i5jhHok UzeyVBVlEqVlEOUKnRJdh7Ltr0mD3Vs89b9w8c4= X-Google-Smtp-Source: AK7set+oaX8mque7/MRijPOgZBFr5UF9aN38EhqnKSzRKJmPKh5wT8nXT/686Xjz9lcbZZMtBMIg8Q== X-Received: by 2002:ac8:5c87:0:b0:3bf:e005:3a85 with SMTP id r7-20020ac85c87000000b003bfe0053a85mr15072148qta.5.1678487711657; Fri, 10 Mar 2023 14:35:11 -0800 (PST) Received: from F (50-78-240-110-static.hfc.comcastbusiness.net. [50.78.240.110]) by smtp.gmail.com with ESMTPSA id a192-20020ae9e8c9000000b0073b575f3603sm632504qkg.101.2023.03.10.14.35.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2023 14:35:11 -0800 (PST) From: "Regina Obe" To: "'Tom Lane'" Cc: "'Gregory Stark \(as CFM\)'" , "'Sandro Santilli'" , , "'Regina Obe'" References: <003001d8f4ae$402282c0$c0678840$@pcorp.us> <000401d94bc8$48dff700$da9fe500$@pcorp.us> <167762779361.628976.14009177203307564086.pgcf@coridan.postgresql.org> <005401d95083$26ca24a0$745e6de0$@pcorp.us> <995823.1678478825@sss.pgh.pa.us> <004b01d95394$16123ee0$4236bca0$@pcorp.us> <1012975.1678486476@sss.pgh.pa.us> In-Reply-To: <1012975.1678486476@sss.pgh.pa.us> Subject: RE: Ability to reference other extensions by schema in extension scripts Date: Fri, 10 Mar 2023 17:35:05 -0500 Message-ID: <005501d953a0$906c4df0$b144e9d0$@pcorp.us> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQFgXZxpr0yOB+9uS1Xwc1lFBKthIAFb3UkpAlqGOBEBdWkvegLXfdbzAh2KTDUCqQCSKwHAG++5r3Iw8hA= Content-Language: en-us List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > No, pg_depend is not the thing to use for this. I was thinking of a new field in > the extension's control file, right beside where it says it's dependent on such- > and-such extensions in the first place. Say like > > requires = 'extfoo, extbar' > no_relocate = 'extfoo' > So when no_relocate is specified, where would that live? Would I mark the extfoo as not relocatable on CREATE / ALTER of said extension? Or add an extra field to pg_extension I had tried to do that originally, e.g. instead of even bothering with such an extra arg, just mark it as not relocatable if the extension's script contains references to the required extension's schema. But then what if extfoo is upgraded? ALTER EXTENSION extfoo UPDATE; Wipes out the not relocatable of extfoo set. So in order to prevent that, I have to a) check the control files of all extensions that depend on foo to see if they made such a request. or b) "Seeing if the extension is marked as not relocatable, prevent ALTER EXTENSION from marking it as relocatable" problem with b is what if the extension author changed their mind and wanted it to be relocatable? Given the default is (not relocatable), it's possible the author didn't know this and later decided to put in an explicit relocate=false. c) define a new column in pg_extension to hold this bit of info. I was hoping I could reuse pg_extension.extconfig, but it seems that's hardwired to be only used for backup. Am I missing something or is this really as complicated as I think it is? If we go with b) I'm not sure why I need to bother defining a no_relocate, as it's obvious looking at the extension install/upgrade script that it should not be relocatable. > > So you are proposing I change the execute_extension_scripts input args > > to take more args? > > Why not? It's local to that file, so you won't break anything. > Okay, I wasn't absolutely sure if it was. If it is then I'll change. > regards, tom lane Thanks, Regina