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 1whDb3-0005Ii-23 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 21:44:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whDb1-002ntO-0C for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 21:44:51 +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.96) (envelope-from ) id 1whDb0-002ntF-0P for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 21:44:51 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whDay-00000000344-0WWS for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 21:44:49 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 06B8E1D0007A; Tue, 7 Jul 2026 17:44:47 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-05.internal (MEProxy); Tue, 07 Jul 2026 17:44:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=partin.io; 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=fm2; t=1783460686; x=1783547086; bh=rEMFMqs/i1y5L+NhKNtEzqvestoFFrbXK49M8ppTRYM=; b= ZppVT3crUweGuBmMGXTe2amXUuTi9s0y7J3F95bA+asxHC0PWTIgv536jaerxssz 4STteWyTCusOEzv4gFNvk48NZg1GxlnzIvpQt3D5ct/GLfHIimO6CnsYcfQvIgdP DEvYuFjcIsfJGyYcogWzhCnk7wNtGAzlUniuR1BKSsEWCWQUsQYW4onumk06Eyya e1YzDZokwjFkIg9GDA57su+jyP4HvE4vLUj77b4I3svUscSxb9Qpvmdu2Y9r/4fR m/PsZga0LKLnBmZGwxMRez7wOE2yowQU/nHiMRQPRd9W5FuVX+zAWgJJo7DtMAIV /SLoJrWgmvHbsl9gh9pY8g== 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=1783460686; x= 1783547086; bh=rEMFMqs/i1y5L+NhKNtEzqvestoFFrbXK49M8ppTRYM=; b=l WWcEwCkv5m9M08KTGh9Sh3zfVLofEQjMw5u401f8eAMgdtHZ40RakMGc4UTJGK1p B/iGMZeonPCMUsEsjO4x3iiiMiTLA+Qz+8/f6MkwjWk9kgro9FGjMdlRdbAVe0i7 27LuCiEZH/29fKfiM+uELWpCrLUxuD6pDFLVdEgOWNGIvXdOYcSdTWElyM0pN5Wa gP3mRVRvsan8pSpSb7CY0uTsDvW2z8NaaNEYLmRYiL5eKc4JTpA2f7+MCVPcBK41 aVwoNAvURUZw4PCwpaSuSRB0HgBRddO9UMGRcIpSQUl6Vw12s3YOyb2FDy6pnKn8 Lh+scskDeKWAZYbDNFyHg== X-ME-Sender: X-ME-Proxy-Cause: dmFkZTE9ozQsWBUM6lAcmfqs5NXle4GR5slMgg4OC1hsGuTolMwla7eQaF4uoiye/Cp9od Zo21M4wwaEiKrtP8V0FssTvb3rFoHqDURv0ZlRCQpgiPjdH25X1zv+J01fAzacYhpJczpD b8fzXMo2e1VdJ2pLz/0MkIpqVsNEZxCHy11rjg8u3yPEC0NaLVOxYa5tnkEgLi7yeZZwL4 NsOq8pWYmRXhuHaQlEos807uK6cMvrlCjxQuDW+Gz306Z9OanivZfT5A7G8+O/yohi4qtr qglz7Rv+UsDPntkklBjFOgfQ7ME/XPDdL4MkIntZWTrWWa2HZth2ZmCLYH4SDHFw2uNUkW RU7St9BckEsRc3Kcv5UvvOPHkC+7ElJDwn/EslHeFze3xqImBP2NkHsqrYk8TqiqI2OLtS 215SNtfCoa3e4vy8Un1jj2Fq7VtqYF4CCEBpN5GRiAeCXol2CEm8AmF9no0YfpHZlleL0z aqajDq/paY/bOzT4OgTxpHNGjlYF50AUvfTCUH0dYT4nSyznEPG2pVyfXz7EZR2EJBD6cu wXDtgFtQvFopjNDSvNIAUdkn79DmY2cxSxbQuqJT1xGNtSKKK4JPIEGAuEvrg6UvW/mnmh TcvUG/e04O5/mJRQAFJmcTCdVdJH0VyZHkS4tdcwlF+1ZYHX22iXbiMC6bew X-ME-Proxy: Feedback-ID: idd01497b:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6E44F780AB8; Tue, 7 Jul 2026 17:44:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 07 Jul 2026 21:44:46 +0000 Message-Id: Cc: "Zsolt Parragi" , "PostgreSQL Hackers" , "Daniel Gustafsson" Subject: Re: Proposal: new file format for hba/ident/hosts configuration? To: "Andrew Dunstan" From: "Tristan Partin" X-Mailer: aerc 0.21.0 References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue Jul 7, 2026 at 9:21 PM UTC, Andrew Dunstan wrote: > On Tue, Jul 7, 2026 at 1:17=E2=80=AFPM Tristan Partin = wrote: > >> On Tue Jul 7, 2026 at 12:00 PM CDT, Zsolt Parragi wrote: >> > Hello hackers, >> > >> > [...] >> > >> > Is this a good idea in general? What does everyone think about the >> > current configuration style? Is it good enough, or should we try to >> > change it? >> >> I do not like it. I have created some VSCode extensions to help with >> syntax highlighting, but I would enjoy deprecating those. >> >> > Moving on to more specific design questions, let's focus on the first >> point: >> > >> > Common, non-vendor-specific configuration formats are INI, XML, JSON, >> > YAML, and TOML. >> > >> > INI/conf is way too simple, and also not really a single standard, as >> > there are many different implementations. XML isn't that popular >> > anymore. >> >> Agree. >> >> > That leaves JSON/YAML/TOML. These all share one new requirement >> > compared to the current PostgreSQL config infrastructure, valid UTF-8, >> > but I don't think that could cause any practical problems. >> >> I think you have settled on 3 good options here. All of them support >> JSON Schema[0], which is super useful in validating files. >> >> > YAML is complex, and has many unintuitive features. While it is quite >> > common, I don't think we would want to include a full YAML parser in >> > PostgreSQL, or try to write our own. We could try a limited YAML >> > format, dropping some complex/unsafe features, but that would be as >> > unintuitive as the current configuration formats, and could result in >> > compatibility issues with existing YAML tooling. >> >> Completely agree. >> >> > My initial choice for prototyping was JSON, and I ended up creating a >> > few prototypes for pg_hba with it. At first I liked it, but the more I >> > worked with it, the more I felt the JSON boilerplate hurt readability. >> > It's still a fine machine format, but I don't think it's a win for >> > humans editing config files by hand. Its obvious advantage is that we >> > already have a JSON parser in the code, and we could extend that to >> > handle the more human-friendly JSONC/JSON5 variants. >> >> Agree. >> >> > During pgconf.dev several people mentioned TOML when I talked about >> > the idea. Initially I dismissed it for mostly the same reason as >> > INI/conf, as I thought it was too simple. But when I decided to try >> > it, I actually liked it more than my JSON tests. It has a precise >> > specification and many libraries, so it is both easy to parse and >> > read. >> > >> > I'd like to focus on this now, on what a specific TOML configuration >> > could look like. (I am not saying it has to be TOML, it is just the >> > best option I've found so far, but if you have a better suggestion, >> > please share!) >> >> I like TOML, and it is quite popular. Another option is KDL: >> https://kdl.dev/. Not saying that I think it should be used; only >> mentioning it to give other options. >> >> I think the best option other than TOML is JSON5. >> >> > [...] >> >> [0]: https://json-schema.org/ >> >> >> > Having implemented two (!) JSON parsers for PostgreSQL, as well as recent= ly > a json schema validator extension [1], I have some skin in this game. > I am really not a fan of implementing more and more little languages insi= de > Postgres. Doing so will incur a non-zero maintenance burden. > > [1] https://github.com/adunstan/json_schema_validate Yes, thanks for stating that. Do you view the file format as a problem=20 at all? In Zsolt's proposal, he vendored tomlc17. Do you have=20 a suggestion for an alternative approach? Is depending on tomlc17 and=20 not vendoring an option? Would that assuage your maintenance concerns at=20 all? Do we have requirements for when Postgres can take on another=20 dependency? Daniel Gustaffson brought the file format up in his=20 "Serverside SNI in PostgreSQL 19"[0] talk at PGConf.dev. One thing that hasn't been mentioned is that higher level configuration=20 languages can "compile" to JSON. For instance, HCL[1] (HashiCorp=20 Configuration Language) and Pkl[2] have that ability. If we settled on=20 JSON, then users could use these types of languages for higher level=20 writing of configs. Additionally, I would add that maintaining our own custom format comes=20 with its own challenges and warts as well. See /no_sni/, which I learned=20 about at Daniel's talk. [0]: https://2026.pgconf.dev/session/757 [1]: https://github.com/hashicorp/hcl#information-model-and-syntax [2]: https://pkl-lang.org/ --=20 Tristan Partin PostgreSQL Contributors Team AWS (https://aws.amazon.com)