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 1twiX7-00GtfJ-RE for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Mar 2025 14:12:05 +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 1twiX5-003te1-N7 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Mar 2025 14:12:03 +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 1twiX5-003tdt-Cw for pgsql-hackers@lists.postgresql.org; Mon, 24 Mar 2025 14:12:03 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twiX2-000shH-0m for pgsql-hackers@postgresql.org; Mon, 24 Mar 2025 14:12:03 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43cfebc343dso33157145e9.2 for ; Mon, 24 Mar 2025 07:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742825519; x=1743430319; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vQqMeVXWdfX7QxPt7LofBgkXeBMyqx/xsJ++yI4NqQE=; b=Y+wR4vgSez968XrQmBSBYIyA/qCmMPuzzTgmTLMXfuse9ULgyzby9B1bL4SRQtQK7x fzWSVTT7GG4WWmjtX+ygcZbBvtCSXfzE8D9jd3trp70FJj9dYSKDUc12lNd8VQwCvPuT VLRf9v4aDP3CCZ6wGa1salk74pwFHlmehi3H8b+IAVdgO/PQZYWdaUq0A3wyvmXP3S7T 2grk+l7RDariLgl6zBaPs1n0+zSAjaAGH4HNYqu9gCjhfCDtt521O74Jyj7LZT2b6mm4 ZXFZ6ZYO8KFc9R1Droym3WlRFRb5xaUVOMKfuvKySbyMYHqbqfr8NV9Boz41kI3dlUBq k8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742825519; x=1743430319; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vQqMeVXWdfX7QxPt7LofBgkXeBMyqx/xsJ++yI4NqQE=; b=nH3AtvdRTYg7phqvImkxhmIeubAmt0YGYEB5w2hSypy75Y4MqcQ0CCaxrhd47Arout KkR/7tmGlOJ++cTtCka2FAhpwCU8GSlxgq37Nt8fSViBRdb36dQ90xWMJGXkXJ8+sYeA Bi/QLp7jcBqyBj00mHY/O0LU2BTedjGLtjh86bYB1uzRoWQNeukxe5jntH4yAQrzInE6 0psdcj6cfR8bHYpqLXzqNF1gl50Xt9yISVsnsaUih44CQ//dBoCNUrO7hmId3Faxiry+ SizK3a9ZzjQcs9WEWIoOBbdDkAJghVZ4SzIpO41a2a7Mv8ukXm4kzx1uqS7aDWvW1dEd gDbA== X-Forwarded-Encrypted: i=1; AJvYcCVFJeb5KEtqqeYUQjooSJnMNX+FKPVdLMmuWPhX+d6qJpTpb6cq9ohr2SZ85Zbnm3MQrKYrUrZNOLiex2qt@postgresql.org X-Gm-Message-State: AOJu0YzHNSJ4JMx34N5i7DSWBNKbISVcmB/Z32YVLdu/qL8Wd/07ZHXu 4Pjn0MBcXrGBVLcnU1jj05nK814mDdo5d1UrLGczSMqRyTCWEKBfC4w8KSgOK68= X-Gm-Gg: ASbGncsRUBUufEN8oogNNBiD0zkqeVM6YMnLGDmvCLMUQOEG5dTIO+/ueIoHEd/592p yLQzSKlFKoWjcXISC7ketRugBq2k0RLSVjCthLr//+kegRxRT1DUVTczPkufC+KQoWenaw/halN 7KBNXqldgSwED8ZrPsfC7hpREW9C6JogSETZcQkXeH3D8Yfz5/gsAppxxYu86rhcw5WqltoFN04 ZmStYtEsl5oY/cI49Mxiw1L3DjjzrNk9IGkbI/GWZZqZo7vP9TKMLOgOSYSVCoT4Q2Ok8MWPUao /2JquVrgOPrKXc58HJ04iaOY/pq0+U8dw528aXX+9ttx9N5LyLPlo5sbgnAw12rrX4h+I/QKtFv 5HzlqpOGhNrs61g== X-Google-Smtp-Source: AGHT+IEaySoBC8clfDlbh23O+8zXCPr79BCMjFoTUwyQpzGabLgsqTaK1FQdrbsu/0dxI2n2zBTzdA== X-Received: by 2002:a05:6000:4014:b0:391:6fd:bb65 with SMTP id ffacd0b85a97d-3997f8f5e17mr12687822f8f.9.1742825518546; Mon, 24 Mar 2025 07:11:58 -0700 (PDT) Received: from [192.168.0.89] (84.123.232.230.dyn.user.ono.com. [84.123.232.230]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39abfc2115asm5062698f8f.4.2025.03.24.07.11.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Mar 2025 07:11:57 -0700 (PDT) Message-ID: Date: Mon, 24 Mar 2025 15:11:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add Postgres module info To: Tom Lane Cc: Michael Paquier , Alexander Korotkov , Yurii Rashkovskii , PostgreSQL-development References: <506788.1733941263@sss.pgh.pa.us> <2c215c98-f713-4c5b-b21a-a4b8fa41890b@gmail.com> <556341.1733967371@sss.pgh.pa.us> <0844622e-9967-409a-8038-470a36f1039c@gmail.com> <8b81a3c0-761f-4cfb-97c6-68819fe4d282@gmail.com> <982748.1734059835@sss.pgh.pa.us> <0e82bf8c-ae70-498d-861e-dba2bb154cad@gmail.com> <29d29c3e-ac9e-48cc-87b4-b1cfd8c2ede8@gmail.com> <992ec366-5c0d-4f23-a02e-30e663613f44@gmail.com> <4476e8cd-6427-4470-98a8-8d61b82d8b1e@gmail.com> <441661.1742683797@sss.pgh.pa.us> <796058.1742757002@sss.pgh.pa.us> Content-Language: en-AU From: Andrei Lepikhov In-Reply-To: <796058.1742757002@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/23/25 20:10, Tom Lane wrote: > Andrei Lepikhov writes: >> On 3/22/25 23:49, Tom Lane wrote: >>> * It is not clear to me what permission restrictions we should put >>> on pg_get_loaded_modules, ... > >> I vote for the idea of stripping the full path to just a filename. > > Works for me. v7 attached does it that way. Thanks, you've done almost all the job. > >>> * I'm not happy with putting pg_get_loaded_modules into dfmgr.c. > >> I just attempted to reduce number of exported objects here. If it is ok >> to introduce an iterator, the pg_get_loaded_modules() may live in >> extension.c > > Yeah, I like that better than leaving it in dfmgr.c, so done that way. > The iterator functions also provide some cover for dealing with > on-the-fly changes of the file list, if we ever need that. It also gives extension developers a tool to detect conflicting modules any time we need it. More elegant than the SerializeLibraryState(). > > I converted pg_get_loaded_modules to run just once and deliver its > results in a tuplestore. That's partly because the adjacent SRFs > in extension.c work like that, but mostly because it removes the > hazard of the file list changing mid-run. Ok. >> Yes, additional burden to bump version string was a stopper for me to >> propose such a brave idea. > > After sleeping on it, I think we really ought to do that, so 0002 > attached does so. With the concept of the PG_VERSION string as a version, it looks more meaningful than I've thought before. Patch 0001 is ready to commit for me. Patch 0002 I just checked on the errors in module names. That's more I can do here? ;) Seems good, no errors found. -- regards, Andrei Lepikhov