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.96) (envelope-from ) id 1w2XKs-000Naq-0u for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 16:32:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2XKr-0038SY-0Q for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 16:32: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.96) (envelope-from ) id 1w2XKq-0038SQ-2Z for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 16:32:00 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2XKo-00000000dNL-02xm for pgsql-hackers@postgresql.org; Tue, 17 Mar 2026 16:32:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2026010100; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=2acHBwcFWl7etLsmiI2P4Kb9XuQBYFRWUJD5QiMbRPw=; b=p+Vn0 3/YqebyI6D/45MVLnu/IDxHnuXufB19axEEuO9N/2E3QFRlfPBR/2cCTS6EuLZhUsnkpaFnPIJxZ+ lqz/gcc9BqbunGL8Vyxy9V2LGn2qSMY3ZBm2cttp3SoQ2+I2/wtOElnFNrvQkjh1QvLn1N+6a1clh F0d/k3LzHUy0p5l5A2wHwo+TQs8tixB9JZvs0oWo+7snBl0dqmEhIVWhGby7zqci+NtLa5luiMH9X WK8zvpbyyFO9CtTqPshWfhTivG9w/vk3vUqdYMiT3BHf4cIF9KzvO4seePhJh0yZFreYJ/FHEtLTf DLkT1YpmldGn9eM1FEZRkitdsSSew==; Received: from bruce by momjian.us with local (Exim 4.98.2) (envelope-from ) id 1w2XKm-00000005nvO-1Lz0; Tue, 17 Mar 2026 12:31:56 -0400 Date: Tue, 17 Mar 2026 12:31:56 -0400 From: Bruce Momjian To: Andrei Lepikhov Cc: Jack Bonatakis , pgsql-hackers Subject: Re: Read-only connection mode for AI workflows. Message-ID: References: <64f1c69a-ceff-4b17-8298-58f255d075fc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 17, 2026 at 09:52:24AM -0400, Bruce Momjian wrote: > On Tue, Mar 17, 2026 at 11:04:25AM +0100, Andrei Lepikhov wrote: > > On 16/3/26 22:25, Bruce Momjian wrote: > > > On Mon, Mar 16, 2026 at 10:01:22PM +0100, Andrei Lepikhov wrote: > > > > > I do think the underlying problem of safely exposing databases to > > > > > automated agents is becoming increasingly common, so it seems like a > > > > > useful area to explore. > > > > > > I agree the need a read-only sessions is going to get more urgent with > > > MCP. Why doesn't the community code have a read-only session option > > > that can't be changed? > > > > The pg_readonly project aims to answer this question: if it is easy and > > cheap to implement as an extension, why do we need to touch the core? > > I think it is a fundamental feature the database should have by default. I now see that pg_readonly is cluster-wide: https://github.com/pierreforstmann/pg_readonly I agree we should have a per-session control that cannot be changed. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.