Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vBj4h-0045dt-Nz for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 00:21:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vBj3i-002GRW-Kc for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 00:20:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vBj3i-002GR1-AS for pgsql-hackers@lists.postgresql.org; Thu, 23 Oct 2025 00:20:01 +0000 Received: from mail-m16.yeah.net ([1.95.21.17]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vBj3a-003hdX-1a for pgsql-hackers@postgresql.org; Thu, 23 Oct 2025 00:19:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From: Content-Type; bh=k+oKuVBfyWxH12rFg4txfEcuR86yWb0sO+0YiAEc+LE=; b=Z4fp1d99rslLHs3vM6ahQjq94rX5KM2hGS4ESnuqx48N8ME4rLIQ1LzQeVVWB5 gSv6oiK4kZRF7KlE2dcDb4JSkeBdywOrP+xUSi48KImdZJ0vofhL29rdtxvF+akt nyon/Di1TnJnGlrpUA+5u0ikcTc+K1NVJ+WsKfPccCvhM= Received: from [IPV6:2408:8210:3c41:ae50:24bd:bc13:a7d1:2bb9] (unknown []) by gzsmtp2 (Coremail) with SMTP id Ms8vCgDX3sqjdPloARZ3AA--.58280S2; Thu, 23 Oct 2025 08:19:47 +0800 (CST) Message-ID: <45555a7a-f987-44d5-9f8a-593063f37ae2@yeah.net> Date: Thu, 23 Oct 2025 08:19:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Include extension path on pg_available_extensions To: Matheus Alcantara , Pg Hackers References: Content-Language: en-US From: Quan Zongliang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: Ms8vCgDX3sqjdPloARZ3AA--.58280S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw1fKrW7tF4DZr4DXFyxZrb_yoW8Ar4kpr 1fJrya9r1DJr4UJr18tr1Utr1jgr48Jr4UJF1Utry8Ary3Ar4Yq34jyr1rJryUJryrXF1j gF48Xw1UXw1DAw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j4ii3UUUUU= X-Originating-IP: [2408:8210:3c41:ae50:24bd:bc13:a7d1:2bb9] X-CM-SenderInfo: htxd06xrqjzxxdqjq5hhdkh0dhw/1tbiIAPdAmj5dKPQNAAA3e List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/16/25 8:18 AM, Matheus Alcantara wrote: > Any opinions on this? > > [1] https://www.postgresql.org/message-id/CAKFQuwbR1Fzr8yRuMW%3DN1UMA1cTpFcqZe9bW_-ZF8%3DBa2Ud2%3Dw%40mail.gmail.com > Just as the discussion here. Adding extension location is a good idea. Suppose there is an amcheck 1.5 located in the $system directory. There is also an amcheck 1.4.5 located in another path. Strange results will then occur: postgres=# SHOW extension_control_path; extension_control_path ------------------------ $system (1 row) postgres=# CREATE EXTENSION amcheck; CREATE EXTENSION postgres=# select * from pg_available_extensions; name | default_version | installed_version | comment | location ------------+-----------------+-------------------+--------------------------------------------+---------- amcheck | 1.5 | 1.5 | functions for verifying relation integrity | $system This seems to be fine. However, if another path is added, strange results will occur. postgres=# SET extension_control_path TO '/Users/quanzl/build/pg-availext:$system'; SET postgres=# select * from pg_available_extensions; name | default_version | installed_version | comment | location ------------+-----------------+-------------------+--------------------------------------------+------------------------------------------- amcheck | 1.4.5 | 1.5 | functions for verifying relation integrity | /Users/quanzl/build/pg-availext/extension The results shown here will cause confusion. It is better to show the path used at creation. So, it would be a better option to add a new column to the pg_extension table. -- Quan Zongliang