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 1whDEU-00051s-2M for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 21:21:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whDET-002iye-0T for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 21:21:33 +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 1whDES-002iyU-2O for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 21:21:33 +0000 Received: from mail-yx1-xb132.google.com ([2607:f8b0:4864:20::b132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whDER-000000002tw-0luq for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 21:21:32 +0000 Received: by mail-yx1-xb132.google.com with SMTP id 956f58d0204a3-66666bad8beso103742d50.3 for ; Tue, 07 Jul 2026 14:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783459289; cv=none; d=google.com; s=arc-20260327; b=qHCnRzIH8VZQ4vNuBB0+Zq8FSreFVdE5xnyPe5Cz6Lf0MUwxycXUPDFAyRREfVjZs2 1unOenMDbWAgEIWQtKiHahjxYwfxG0SiA3b2Q4mQpUnEPui2K1jGKkLHSbPC1TmtZOp7 NjDLWSxQZy4IdGfXcgM+XjtrdGuXJWROYc+nJSETNd4BWHNc/l+SWEcirtrh6OTWEkMI 9tEswTpKmdayVAQCW/Non2vKT2cUVCBa52NUh2iYKtJYLQ0qXxdL91KRJRW2jMZwvuil ZaFaNtQEPXDwte6gAO9NTXslHxRq2GHxTC9JJXyWPP4xswvgyzG5ENFmZ8Jxa3rRtGQv Tcbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=qF7ARnZYlnYZooh5gE8m7Zatk0F2jF6VBmJSPQQE+F0=; fh=fgYsMDWMJYs4eNkGObJ21DmWPF2iwmDa17G7JGjo5gU=; b=sm9Pcd0y+UP9wIDhpEZ4+KabLz0//ptopCFDRx4npUagwXEKxtTI7/NaOPCoYyRPtB xM7E1b8Hik7YP37R6LsBEznBEnUVjb4N+I1fMHxix9u3wMgTu4sa69Qq4Gz94g4eb+ck z+uGxiw0df76IZCk+IOGf9A7oC6piLP0elpu7QXt9sbkVXVUdzwZbnZRszsPZ9NPloSE vJDTjyOUdEVpisnnOlwzl4XtjoWLGX9SES0bc9gylRnkQc45Rd0gM8UqPXoRsDwGNH+l zomHQLCU7z8T0zZq4/XCE+TELb+6A3yNYsIzIpwgb5GClzIPTypk9zwvVSat8EYg/zEi mkJw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20251104.gappssmtp.com; s=20251104; t=1783459289; x=1784064089; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qF7ARnZYlnYZooh5gE8m7Zatk0F2jF6VBmJSPQQE+F0=; b=f11ZtIdoWzFsNVg9HJk+tybszjsuBxxEPhtsc69h9zaerxFsupZC4hlolyzSAFeI4y YbDqTA+/JaIMk7xjd/jPqJk59vWLKDp7LrP1PD7NZHH9jmKnXy3EzyUS7qSFJniTIALC 8Od89hu7OF7tQ1ScrCW/TaCFXqMdCUueIPG46x+DbbKVCelMRFNo8UZTJbUXk+TaYyzF mfNJcLRiAyEYhr3fw91L/4wBQRSkAMsIvhlpL/KiNgDN33HLWnm659YEvb5bZDqvDT6c ecpOO8R8y4P/N7jtUkb2Dq33SfwMXi6A/d+mKsr5mWo/3hi+0K5ae19+hc5qVQaRlch+ ffZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783459289; x=1784064089; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qF7ARnZYlnYZooh5gE8m7Zatk0F2jF6VBmJSPQQE+F0=; b=EX2P7Uqg6GuMsLFiyrVl905VbbbJg9lCihU7B3sBGnbtF8iVakbbLIKd+lms3Ig9+9 B/THReFtxXrpgCQYe6Xy/Ihlvv3hTGt+M5WqVtYEV3rRT11eoQtxMbJcz6EP8aIFWzKY Zwl/01yY6DXVWBdsPxkJYC/jbi+1Q/ulLUlxLz5kDlWtspNpNKdGWUtEibUxvQbzmpwp KZy+N6U0HIYE3HmXQ5AaowXqrzvBkoJbDIO1rmqTW2HMnqXM80LBB+DGhSxZEvSTi2/E 40UdZAYYVkVhN++mo1QWrCvr8zrybImPyzuYh42Hcr6IuruajMXNfi+WZawCGqMBoe+F OsPQ== X-Forwarded-Encrypted: i=1; AHgh+RqaoLu0t31knzZ6vcJOYH5wRkHQ3gwSK5/iqXh9Lx9V/DBfPIZzzHEYw1zYOBY5ymX9wDhz4dYYRkgPzOUo@lists.postgresql.org X-Gm-Message-State: AOJu0YwW3t/MiCPEwfI9ahkF6+uqJtjljFcZU9lREAt5NufCGT+gdYuM lwxOulCr6Qc6MOubqgdEA0bVA7iEzqHAMYPeBNDQNp7ToPj6C2Mq94P0MV6hj8n+KO+yVOT7JLm G4HMa0TWv8ARj3bUejDyn+mbeHS/J/Q3Odr4OKLlTIw== X-Gm-Gg: AfdE7clE5qv6ZmxW4QTW/DxrTd/YDeXOBjPtIxxqD/njTrGea0OuWPw3k+4LJvIgpZW qQdm4/GFIW8k9wtl3jM3ngLA43PisADPxyLMKGxGCmopwHhc8irIMh8y7biwOYmKVwsMkxy+mqN QaPPsMOK8YyklMMLoPawZNMoFC0yCkBz0PMiaw7nyKXvr8dhus9ty2B1QS9UVGfRMrocCCFB8Rd kkh9HjXzr50p5BlCXMSyv+GdLEN+88IL9Ol7CkhS70oXfwc0DYCzWsIXSAPXNTzWWSqC81S5X2J UQ8r+PSw7Q== X-Received: by 2002:a05:690e:1248:b0:667:953c:701a with SMTP id 956f58d0204a3-667953c7feamr1864278d50.68.1783459289534; Tue, 07 Jul 2026 14:21:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Dunstan Date: Tue, 7 Jul 2026 17:21:18 -0400 X-Gm-Features: AVVi8Cfpbqc0oFmGrJdQCwtyfWhnkVOFe-ruqnnn9CGX3bvbylqNge2bq-CNaJk Message-ID: Subject: Re: Proposal: new file format for hba/ident/hosts configuration? To: Tristan Partin Cc: Zsolt Parragi , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="0000000000006ca3a406560bf944" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006ca3a406560bf944 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 7, 2026 at 1:17=E2=80=AFPM Tristan Partin w= rote: > 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 recently 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 inside Postgres. Doing so will incur a non-zero maintenance burden. cheers andrew [1] https://github.com/adunstan/json_schema_validate --0000000000006ca3a406560bf944 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jul 7, = 2026 at 1:17=E2=80=AFPM Tristan Partin <tristan@partin.io> wrote:
On Tue Jul 7, 2026 at 12:00 PM CDT, Zsolt Parragi wro= te:
> 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 fi= rst point:
>
> Common, non-vendor-specific configuration formats are INI, XML, JSON,<= br> > YAML, and TOML.
>
> INI/conf is way too simple, and also not really a single standard, as<= br> > 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<= br> > 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<= br> > compatibility issues with existing YAML tooling.

Completely agree.

> My initial choice for prototyping was JSON, and I ended up creating a<= br> > 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<= br> > 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 configurati= on
> 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://k= dl.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 pa= rsers for PostgreSQL, as well as recently a json schema validator extension= [1], I have some skin in this game.=C2=A0
I am really not a fan = of implementing more and more little languages inside Postgres. Doing so wi= ll incur a non-zero maintenance burden.

--0000000000006ca3a406560bf944--