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 1vBvno-006zvE-RK for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 13:56:28 +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 1vBvnn-008xb2-Mx for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 13:56:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vBvnm-008xat-UE for pgsql-hackers@lists.postgresql.org; Thu, 23 Oct 2025 13:56:26 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vBvnk-003MJu-0B for pgsql-hackers@postgresql.org; Thu, 23 Oct 2025 13:56:25 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2F149140010B; Thu, 23 Oct 2025 09:56:23 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-07.internal (MEProxy); Thu, 23 Oct 2025 09:56:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1761227783; x=1761314183; bh=p38blCJdMhCURA7jAjEwGO7a9ziUtrfM960+hNuOf7E=; b= T8Ag2tqZ7MKUIiQCTssYQZyZBIJ3qgK00nnOhzHEeh4R2Zm4/rZ+1qXGrMB0rght oSViOvHtKrTA1HunsmcOa1FCn8eyhIbCWJl4NC2Cla0f2BsN/1qDrjjiq0HXixUX lHFCibzgvY5DqVGs6mtmm9PiPwYl8SMEQEUSBmdvb7fp4qSXFGaPFu9gCroHagzj CUb0Opcd9Ue1El/STpe9oj/rqjM1edtcKAliLdtyPK39tUCVCtQ1QAKcLBx+oLjj LV01l7kS8KL0ixxm3sQAkNI6stUTOe2FTiOY0glNHdwf91ysRzyhaKC+YAmE+GTd DJqCeJpkd3zFrjsGC4Y27g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1761227783; x= 1761314183; bh=p38blCJdMhCURA7jAjEwGO7a9ziUtrfM960+hNuOf7E=; b=a W+zWLUmdQZ6QWus5xpwlB1hEO6pSedtQzfVabyirWQ/EJJ4g2jsb3kDe9f2vMuCc Gb+W/EeZfrFpUOaEXrLrKJtHQm+e7NI3HxsIkBUXlz8fNQ67eRx2BlDY0dhIZ995 LGgn5jKb8aorw8W5UZMTx0BYAeZeLZTTB8KYBowe/eMPZ7C0ttnOspxj/xhOQILU lTQtoMeqP/cgHK0fEfMM4o4ivUlq6HNTMVm3MDBmM8lY3lNaReKz7X3eozxNmhh8 DjTvKTKKp5OQiiCdLAgrXvJtuDTZSxaGyyq5mmmAwwZgMk3zCRJNpJXfOwm47IUn L1CvXW7voJUsmENZw7GFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddugeeiieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfgfhulhgv rhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrf grthhtvghrnhepfeehgfejheegleelkefghfetheevheetlefffeejgfdvvdduieevheeh keejveeunecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepvghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohepge dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhirdgvvhgrnhdrtghhrghosehg mhgrihhlrdgtohhmpdhrtghpthhtohepmhgrthhhvghushhsshhilhhvleejsehgmhgrih hlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghs qhhlrdhorhhgpdhrtghpthhtohepqhhurghniihonhhglhhirghngheshigvrghhrdhnvg ht X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id AC5171820074; Thu, 23 Oct 2025 09:56:22 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: ABVVUoxdfgL7 Date: Thu, 23 Oct 2025 10:56:02 -0300 From: "Euler Taveira" To: "Chao Li" , "Matheus Alcantara" , "Quan Zongliang" Cc: pgsql-hackers Message-Id: <5aaee744-342c-4ec8-a2ef-ffa0969cc51c@app.fastmail.com> In-Reply-To: <0DDF33A5-4F8C-4725-A124-B301147FA1FA@gmail.com> References: <0DDF33A5-4F8C-4725-A124-B301147FA1FA@gmail.com> Subject: Re: Include extension path on pg_available_extensions Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 22, 2025, at 10:28 PM, Chao Li wrote: >> 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. > > > +1. I like the ideal. > Exposing useful information might be a good idea except if it doesn't compromise security. IIRC there is no function or view that exposes absolute path to regular users. The view pg_available_extensions has PUBLIC access. Check similar functions using a query like: SELECT proname, x.unnest AS argname FROM (SELECT proname, unnest(proargnames) FROM pg_proc) AS x WHERE x.unnest ~ 'file' OR x.unnest ~ 'path'; Some of the functions that return absolute path revoked PUBLIC access for security reason. See pg_show_all_file_settings, pg_hba_file_rules, and pg_ident_file_mappings. (All of these functions have a view that returns its content similar to pg_available_extensions.) See system_views.sql. Do we want to use a similar pattern (revoke PUBLIC access from the function)? It breaks the compatibility but perhaps using an existent pre-defined role (pg_read_all_settings?) may be less harmful. There are at least 2 alternatives: * separate function: add a new function that returns the absolute path. Don't grant PUBLIC access. It doesn't break compatibility but you need to modify your query. * insufficient privilege: if the role doesn't have the sufficient privileges, return NULL or '' (similar to pg_stat_activity). I don't have a strong preference but the latter can impose more effort to use if you don't know the role has sufficient privilege. However, it is clear why the absolute path is not returned. -- Euler Taveira EDB https://www.enterprisedb.com/