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 1uJfsL-00403B-Hm for pgsql-hackers@arkaria.postgresql.org; Mon, 26 May 2025 22:00:53 +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 1uJfsI-004Nwp-UX for pgsql-hackers@arkaria.postgresql.org; Mon, 26 May 2025 22:00: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.94.2) (envelope-from ) id 1uJfsH-004NwB-V4 for pgsql-hackers@lists.postgresql.org; Mon, 26 May 2025 22:00:50 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uJfsG-000679-09 for pgsql-hackers@lists.postgresql.org; Mon, 26 May 2025 22:00:49 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id A44AF114017C; Mon, 26 May 2025 18:00:46 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 26 May 2025 18:00:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=justatheory.com; h=cc:cc: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=1748296846; x= 1748383246; bh=KWu6cy1i/aY5hbgrsAHmEw+3pT6O9CB8r9n+iw9NPic=; b=q kO66973qtf6HEfWQlVSycaKKO+z33I5FzLb8OJO1wm9Zp7reyS3J3w29INlVT+cQ 6Tl+LjlRNz3DDgLd7ur3JiKwBASKw6I/at3UTwieE89kM9PT4nS4w683d6Oz5bTb 9j8YBuM3v6x4XIVlq8CvJLhMFbtvuOTCHKdgT58JNExipS9wOBSptj4lklwvnfAf sf9KqEXIT+cxMNdAJf7ibmdkN4DtwUsn7dTBCwDxe1LrXdmR/0vgL9D3maBl5Cro agxanlKLfTO0vB6pPzSzby/ucGai2I5OfB0Oz3RGTuRasZZIDXOrd4UIs0um0DcX 1qUZdtvEK7OcIDxbijZrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm1; t= 1748296846; x=1748383246; bh=KWu6cy1i/aY5hbgrsAHmEw+3pT6O9CB8r9n +iw9NPic=; b=Ofh3O6KSePuN4XtXRe7FHZKqC9cStK6WuP4Ye1DY1betQSUpkAX 9UZ0h0f9fky5Ypzz40CdHA80KikwMszr3bTlqoTjQtxSdYBJ/kqdy5EwQpStjqMB k7iFuvF6/qS7vVYwhvxycu/uebu5PeyIWQNwnYr3v4/77BFSDbcl+YCrZwhgrsq5 P5y2ibsR2YliLj3dK0ruWh4lkxQO6KjiUH8lMrFjMteZtjOQi0mN0UMjwwET2VJy 7alqV8rDKF9OwvLldxpfFoTywXRxH7vZcg6Q+kUAUK742bc8M1+bkvmmtIyIWxWz emhoXyq67fKAOhAokdeYq8/ppoqnxHWlx0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgddukeeijeculddtuddrgeefvddrtd dtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggft fghnshhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftd dtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegtggfuhfgjffev kfhfvffosehgtdhmrehhtdejnecuhfhrohhmpedfffgrvhhiugcugfdrucghhhgvvghlvg hrfdcuoegurghvihgusehjuhhsthgrthhhvghorhihrdgtohhmqeenucggtffrrghtthgv rhhnpefhhfeiiedtfeekvefhhedtgfeihefgffelteejteekiedtueegjeegfeffffekie enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurghv ihgusehjuhhsthgrthhhvghorhihrdgtohhmpdhnsggprhgtphhtthhopeejpdhmohguvg epshhmthhpohhuthdprhgtphhtthhopehflhhorhgvnhhtshdrthhsvghlrghisehgmhgr ihhlrdgtohhmpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtph htthhopehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdprhgtphhtthhopehrohgs vghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtoheprggvkhhorhhothhkoh hvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhi shhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoheprghnughrvgifseguuh hnshhlrghnvgdrnhgvth X-ME-Proxy: Feedback-ID: i7c334307:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 May 2025 18:00:45 -0400 (EDT) Content-Type: multipart/signed; boundary="Apple-Mail=_F33EA439-276C-49A8-834E-57FD0C723ED1"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part From: "David E. Wheeler" In-Reply-To: <696ECBBC-3CBF-4522-AE66-E48225688E93@gmail.com> Date: Mon, 26 May 2025 18:00:34 -0400 Cc: Tom Lane , Peter Eisentraut , Robert Haas , Alexander Korotkov , pgsql-hackers , Andrew Dunstan Message-Id: <59C63857-406D-4704-A1EB-9BF3AA639C86@justatheory.com> References: <145894.1727298237@sss.pgh.pa.us> <7e9debe6-4e96-4b0d-a801-b531e962ef43@eisentraut.org> <01DC1C38-0692-461B-AA63-5394330356BE@gmail.com> <2568904.1748022721@sss.pgh.pa.us> <40912112-7FFE-400F-A38F-368827C4BDF1@gmail.com> <176C517D-2DEB-4CAB-9AE4-261079D313B9@justatheory.com> <8FD5F4CF-9059-40C1-9F0A-C3CBA8DFE17A@justatheory.com> <696ECBBC-3CBF-4522-AE66-E48225688E93@gmail.com> To: Florents Tselai X-Mailer: Apple Mail (2.3826.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_F33EA439-276C-49A8-834E-57FD0C723ED1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On May 25, 2025, at 00:16, Florents Tselai = wrote: > The most important problem in jsonpath_scan.l now is the fact that I = broke the alphabetical ordering of keywords in v2 , > and you followed that too. Oh. They have been organized by length; I didn=E2=80=99t notice they = were also alphabetical. > But you may be onto something with the split_part thing. Yes, I think it would be best if the grammar was a bit stricter --- and = therefore more self-explanatory --- by making the args closer to what = the functions actually expect. >> The existing string() method operates on a "JSON boolean, number, = string, or datetime"; should these functions also operate on all those = data types? >=20 > You mean implicitely conversion to string first? > I don=E2=80=99t think so: I=E2=80=99d expect to work like = =E2=80=98$=E2=80=A6string().replace()=E2=80=A6' Yes. Each of the existing methods has well-defined rules for what types = of values they operate on, and many accept multiple types. Looking = again, though, it appears that all the date/time methods operate only on = strings, so I think you=E2=80=99re correct to follow that precedent and = people can use `.string()` if they need it. We can also loosen it up = later if use cases demand it. >> I'm not sure how well these functions comply with the SQL spec. >=20 > The fact that Peter hasn=E2=80=99t raized this as an issue, makes me = think it's not one Fair enough. Best, David --Apple-Mail=_F33EA439-276C-49A8-834E-57FD0C723ED1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd+KfmbOQis6ZycGGkt9idPjIgfEFAmg05IIACgkQkt9idPjI gfEOCA/8CqB6GD9FgvhugZKSBvRATMaGEGiLaA8kO2dSOEF14PtGJnXqewqBwXQh iPt2SuvlddYJChpsWxn0dtT1z8l66td1UWoBAbvz1D2QqxWu8RkD0Ci0v6Dwg353 23dRhjQdnN0+M/ZtBRPaNLF1Wqb19xsagWLJSlww5uVXQqecfpp+5f9bGZB2vxrc Vgwka3y4Nju6Ud6+OVXD+do5hgu3tb8swF983wrsbKPLnuwN9pcb9r5yD1RDNA3f chyn+tF8A5ZCHtunkK4BvouzecZdJHqQaS2syIzCPjuQ0mDwUSfNF2ot03ECHIZq 4OYXrbWERlelFkM9WFNtyLHaTi9iAsLTCCd6Xv+QeH6f12uSx5N1t7esQdLo0IPT GhDAfc8c99Wb2Qocgf95pcBcuJu0997KyHlI1SDP65LuZpIaa9z1I5BrfoNIJbBQ LIM66J/X0kwZVBLXLsCdXJDtDhOSL21LCJ9BLaZx2PEMhk0XWfyQdS53Qbx1kHRf xykA18MhgLIJOAWn+IBkj2ZDWZgzlygC5bY5+vCNfQ33ygR3hUoji0e9FDDfKtFH QNCHoPEXwLsHA2pAOJ7NXyE78Vx8yWE5zRCPx+PTtTxdpI/kyYOEgl95Q2ySYvLS Hr0V9ljlBWhc8kemPaA6fxPZysh3r7q7oh4ON91Mi0FwCbE1LIQ= =ocnM -----END PGP SIGNATURE----- --Apple-Mail=_F33EA439-276C-49A8-834E-57FD0C723ED1--