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 1uIwhu-00E3tx-LT for pgsql-hackers@arkaria.postgresql.org; Sat, 24 May 2025 21:47:06 +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 1uIwht-00DpNL-ST for pgsql-hackers@arkaria.postgresql.org; Sat, 24 May 2025 21:47:05 +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.94.2) (envelope-from ) id 1uIwht-00DpND-HX for pgsql-hackers@lists.postgresql.org; Sat, 24 May 2025 21:47:05 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uIwhq-000o26-20 for pgsql-hackers@lists.postgresql.org; Sat, 24 May 2025 21:47:04 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 36A0011400B9; Sat, 24 May 2025 17:47:01 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Sat, 24 May 2025 17:47:01 -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=1748123221; x= 1748209621; bh=kEPmxaeQVMfeealo9BkQxLTHYW1+XVn5iZtCigI3Z88=; b=l X+fJpphW3UakMjd6qCeiS6zHO4cQKHIlTCtvgsZgq2xH5iJTuKN2pZM39UBvyAuZ 0FTXU3fXIWoBwT6YGTruooIXrIPrh+GmQEC3IhDWgFCjaJFOSip/6s0WXI+ui/Iv B5GNWSt4R/cntDUU6EtMegu/LsIvEY1Mu174CcV0NvYNVf+cfIx1zrVu/i7XBu46 7f3P/nzJm5SMjzBe0oo4KIVvt/V+O8yJ0G/AEV16ZxFEgwGWyqyRf2QHu05OuXfK cH/c7GAbeVbb7x8otloRNid0U2Gb240NBJd5HIFsPA4qxwByJr8eq9YRdCrzebpA r6grSJeB2ofa+EcwR180g== 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=fm3; t= 1748123221; x=1748209621; bh=kEPmxaeQVMfeealo9BkQxLTHYW1+XVn5iZt CigI3Z88=; b=S98K3G9rQTVmYDRCVNF1G50bxakYWWN/QH4uVt+qiZm8sK3qLqk Jm3If1/ucIun4tTQ9ABqx2zbkjb7bHQV5337QZyAEjGIiP4zoV7jIRZUz3AqZN1j N3y6PWMTbeorObGEVeX2U7PwJnUlrrQgbsiyQzjT/Qwsy0vgeMqUTplH3t0lisrU RhSq25Js6cVThVsgfxp/tN4j0/IcHIV+vBHa/4EHMBXVGOxFPNgRd/mptMwjQqEI lfjxTsaRlrWg8Z2JunbihDuKMkizczm10oX7euwP5owDMrLSTdIXk/jYzOFN//jl DtZs+OgtzCbt9mwSNFnqB3dHCxuHyjBu63A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdduvdekudculddtuddrgeefvddrtd 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; Sat, 24 May 2025 17:47:00 -0400 (EDT) Content-Type: multipart/signed; boundary="Apple-Mail=_568C6CEF-E18E-4156-B503-B58ED9AE023E"; 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: Date: Sat, 24 May 2025 17:46:49 -0400 Cc: Tom Lane , Peter Eisentraut , Robert Haas , Alexander Korotkov , pgsql-hackers , Andrew Dunstan Message-Id: <176C517D-2DEB-4CAB-9AE4-261079D313B9@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> 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=_568C6CEF-E18E-4156-B503-B58ED9AE023E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On May 24, 2025, at 17:39, David E. Wheeler = wrote: > I=E2=80=99ve attached a new patch with docs. Oh, and I forgot to mention, src/backend/utils/adt/jsonpath_scan.l looks = like it has a ton of duplication in it. Shouldn=E2=80=99t it just add = the new keywords, something like: ``` @@ -415,6 +415,11 @@ static const JsonPathKeyword keywords[] =3D { {4, false, WITH_P, "with"}, {5, true, FALSE_P, "false"}, {5, false, FLOOR_P, "floor"}, + {5, false, STR_BTRIM_P, "btrim"}, + {5, false, STR_LOWER_P, "lower"}, + {5, false, STR_LTRIM_P, "ltrim"}, + {5, false, STR_RTRIM_P, "rtrim"}, + {5, false, STR_UPPER_P, "upper"}, {6, false, BIGINT_P, "bigint"}, {6, false, DOUBLE_P, "double"}, {6, false, EXISTS_P, "exists"}, @@ -428,10 +433,13 @@ static const JsonPathKeyword keywords[] =3D { {7, false, INTEGER_P, "integer"}, {7, false, TIME_TZ_P, "time_tz"}, {7, false, UNKNOWN_P, "unknown"}, + {7, false, STR_INITCAP_P, "initcap"}, + {7, false, STR_REPLACEFUNC_P, "replace"}, {8, false, DATETIME_P, "datetime"}, {8, false, KEYVALUE_P, "keyvalue"}, {9, false, TIMESTAMP_P, "timestamp"}, {10, false, LIKE_REGEX_P, "like_regex"}, + {10, false, STR_SPLIT_PART_P, "split_part"}, {12, false, TIMESTAMP_TZ_P, "timestamp_tz"}, ``` Best, David --Apple-Mail=_568C6CEF-E18E-4156-B503-B58ED9AE023E 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+KfmbOQis6ZycGGkt9idPjIgfEFAmgyPkkACgkQkt9idPjI gfEhrw/+NTPniU7h5ENAWDUnYZNMzWJ+iXmYeX7Ecv/B4D6NpUrJVtJWZ4ALjAhA MuQInztvK2T995JgP4DnOBx+IgvHac3yjh2dzfMRaAQ6oH2qehTsSrGLdfgDovdu jHXFJoIzQphKdbmcAm8ucmLzqFzPucO/soGR2Stm065jds3DWm6GFm/iQvgFhxiy SkiKPQ70OUDCnNCTBArAjrCkWaYFSLIv2cMAXrCwofGJvZgW/3zjPLqwX6wuHrmB 8Nb2FS+ytLGl2UzURK5o/ZpVyvVEowTJsgkuXgjhPVhAJyNCxqZH4xOLvtqOws4e UkYnR3zQcmvy0916zsGO+p4k/aPFPj+sx4+UtYZ6fd+UXqUMLlxvm9UtUOBtjhbk YdMyFFmlFnfXcwFiPc/Nskw/3ULkWUHp42V24Ng62ZJBqhqtkImCg6PYUl0YwzV1 6qJtY0xCU+s/Iatj0hwMvsCTLgz+JV0sJknVtcXvA6y3CIPBwgaZxUgPyAieX0dC 70+jFg38XZAUWv9qgCi90VdjUrRp2MQ0AYF/KICpuywS2BEZJCtbfSJEwDbXZzYK Cr6ToVok+T4EdYEYAdmjPA5KLnfd2QtfIiG+dlSPMPTDr5EsbnBLaGK4jGeuysmA I6QjW+5jd+R19aoa9CPJPUyUJzDwvCaRJk9MIwCpYK6IjoG4XAM= =pJsf -----END PGP SIGNATURE----- --Apple-Mail=_568C6CEF-E18E-4156-B503-B58ED9AE023E--