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 1su7Yl-004K1A-UH for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 09:46:48 +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 1su7Xl-006Q2x-HC for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 09:45:45 +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 1su7Xk-006PyE-5h for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 09:45:45 +0000 Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1su7Xe-001KsG-1U for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 09:45:42 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 428151140084; Fri, 27 Sep 2024 05:45:36 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-12.internal (MEProxy); Fri, 27 Sep 2024 05:45:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=justatheory.com; 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= 2016-12.pbsmtp; t=1727430336; x=1727516736; bh=7hh5ptS5dtFiRqT10 CGvMsp8bGjoGA+9WGDX5Wbsg5s=; b=aQoRIGLwPR9zy3HCX+yEdwbxv+arvRWr5 ztTdUwCJMbrP6X8w/SpbMwrOAG+XUUig9nyjG0f1tgfU2o7vcGTMIsfAobuHO6ms B1n4F1zcUaq8AKePb0xWUetPSQ6vAvglOnJsaCP3cUoehUbQeYt2ZUQhn0jES/h3 C014ECTGsg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; 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=fm1; t=1727430336; x=1727516736; bh=7hh5ptS5dtFiRqT10CGvMsp8bGjoGA+9WGDX5Wbsg5s=; b= RCMQNL+RGSfabtYbBWiUJhW42EQLL6XIMOfRnGXG7PJ9Z1AgHTsMCP9RVohCky8z 7lrG2BYm4/6XXZyZAski5sIMIOMi62Y88vx62jkLzkkXXqS4jRAeLPnLZtRYPPiw TiXnSWvWDi4xvP3D3MMIXuc6DCqtt9s6tceKxe1oCFSziI+kQDdtz3O8lbXgC2tr sd54CW5i7sGGWZWPx1tSpTHejl7kY8grbkOpZVjxSB8vr+5OYRszdhz5k8Lil0bv GNsqrEVWaYR0PkCuGfiDQqOvgS45ESaExsYJ9HiadTNK+wyjltSboxG7KaUyzfli 8HUBe2mg+Otn9hn71mR1Zw== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727430336; x= 1727516736; bh=7hh5ptS5dtFiRqT10CGvMsp8bGjoGA+9WGDX5Wbsg5s=; b=I gzHjb95Blqmmq3aZi924CmeViW3IK4T6KlefqdDIE7H7Rt8jfC8c6e0U6IX8f+5H NgvIB2UrrkP4B8o7hPmyfw457lDM9vczBYvYh3baXb/qC0i6IyduoVDQ8Sr61Chu mwRI9k26PiWpkC40FTu8NuqJH3uDrLqT+XmmMvNXoR8C1FkqJNskZ4p1PZtJImcW ShZSR+ZEU6HTbrZKtd0mlFg1WkLxSBrca8oOd5VgDeyyrwR1zkkaaIcRZ7VOMkWt HvS49Q33Oy7zgwDnI/1UKbQFy+HZF4+/re8xsGIRr+HaBbYg95OI18lQdmm5g/3V BbBdeegJlarnjbCf9R5WQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtledgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhhtdej necuhfhrohhmpedfffgrvhhiugcugfdrucghhhgvvghlvghrfdcuoegurghvihgusehjuh hsthgrthhhvghorhihrdgtohhmqeenucggtffrrghtthgvrhhnpeetveeigfdtueetudff jeetfeetudetjeeiudefgfetgeejkeelkeehudfguddvkeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurghvihgusehjuhhsthgrthhhvgho rhihrdgtohhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehflhhorhgvnhhtshdrthhsvghlrghisehgmhgrihhlrdgtohhmpdhrtghpthht oheprggvkhhorhhothhkohhvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhglhessh hsshdrphhghhdrphgrrdhushdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehl ihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i7c334307:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Sep 2024 05:45:34 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part From: "David E. Wheeler" In-Reply-To: Date: Fri, 27 Sep 2024 10:45:23 +0100 Cc: Alexander Korotkov , Tom Lane , pgsql-hackers Content-Transfer-Encoding: quoted-printable Message-Id: <73C52BC6-E708-43CF-A79B-AB22AEDEC8A7@justatheory.com> References: <145894.1727298237@sss.pgh.pa.us> To: Florents Tselai X-Mailer: Apple Mail (2.3818.100.11.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sep 26, 2024, at 13:59, Florents Tselai = wrote: > Speaking of extensible: the jsonpath standard does mention function = extensions [1] , > so it looks like we're covered by the standard, and the mutability = aspect is an implementation detail. No? That=E2=80=99s not the standard used for Postgres jsonpath. Postgres = follows the SQL/JSON standard in the SQL standard, which is not publicly = available, but a few people on the list have copies they=E2=80=99ve = purchased and so could provide some context. In a previous post I wondered if the SQL standard had some facility for = function extensions, but I suspect not. Maybe in the next iteration? > And having said that, the whole jsonb/jsonpath parser/executor = infrastructure is extremely powerful > and kinda under-utilized if we use it "only" for jsonpath. > Tbh, I can see it supporting more specific DSLs and even offering = hooks for extensions. > And I know for certain I'm not the only one thinking about this. > See [2] for example where they've lifted, shifted and renamed the = jsonb/jsonpath infra to build a separate language for graphs I=E2=80=99m all for extensibility, though jsonpath does need to continue = to comply with the SQL standard. Do you have some idea of the sorts of = hooks that would allow extension authors to use some of that underlying = capability? Best, David