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 1tFrcM-00Gssf-3M for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Nov 2024 09:12:22 +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 1tFrcJ-005ZQ2-Pe for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Nov 2024 09:12:19 +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 1tFrcI-005ZPu-7j for pgsql-hackers@lists.postgresql.org; Tue, 26 Nov 2024 09:12:19 +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.94.2) (envelope-from ) id 1tFrcA-003xGB-Lv for pgsql-hackers@postgresql.org; Tue, 26 Nov 2024 09:12:16 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id F05DE114016A; Tue, 26 Nov 2024 04:12:08 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Tue, 26 Nov 2024 04:12:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; 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=fm3; t=1732612328; x=1732698728; bh=PNfn5Q72EGfdqNC12x8cDhcc0BW5+4av CRFXd7wF2Nk=; b=TMVpzXWtiZqNUyf3qL0euWe9TJkLcEadgP/t+ublsSU2Wfmm kAbm3P6ZdnV0eoUM6hzLgk38G+kowseGM+4l7RF5tAySN2Z4E6Os2ZOKFS1NybEc 3MbgVt1KJ3R1qFhcwUwRYTBaMI4eru/Rv6XRwqdtm+lNiUGTpMaVdNuLK0YCyfce JYlQ8ULpC7Usw3fD90jcWmpIXTkSE23AshcZ5f/M8QH5KJD3CWtJqNZecz6/G47z X5G7RUz8fnvLErvjBsWvPeVVb8m7i0qIXICWC1MUA2WoKXDgr88rLLzs45uaFPsT L6TSdcEB4eY8NPUNj9vOFRUTulBT9z+ZioT7RQ== 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=fm1; t=1732612328; x= 1732698728; bh=PNfn5Q72EGfdqNC12x8cDhcc0BW5+4avCRFXd7wF2Nk=; b=K wlcI1C2IzYsGEp0vLBIKqzm+wYh+Rznka9HGJzQxOe+yjK5s4ZXhw8WsTA61tEuY 3mHih8b/Aa3z+AjPWzb1ayiz3meQO7coFyPbwVcS/DABaE6npAe/PKWMWC9HNOT3 kDLQMYasrR9j3pSzQU68SZJi40cBhXUfJ9BCX0wda2iaB8jOTqaZNXTTFTK85WVb 83lKnrsKHRS8CfAIMOlmIRTgc7MWzr8Xs89zBZw7wVGdaDSuRpyoS0BFHw1aprr/ mfZ+RHNV0txForjP8Dr4QUyGROHAUPQLLVHckf12/UrR/jAkifB0koXo24zTVoux VOGot/Nn0c6cGIXflda0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeeigdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepjefhveehtdetgfffhffhfeef gffghffflefgieeuueekhedvhedvfeehffdvfeeunecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdho rhhgpdhnsggprhgtphhtthhopeeipdhmohguvgepshhmthhpohhuthdprhgtphhtthhope grnhgurhgvfiesughunhhslhgrnhgvrdhnvghtpdhrtghpthhtoheprghlvgigrghnughr rgdrfigrnhhgrdhoshhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepghhluhhkhhhovh drnhdrrgesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhs sehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopegurghvihgusehjuhhsthgrth hhvghorhihrdgtohhmpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthies ghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Nov 2024 04:12:07 -0500 (EST) Message-ID: <21fa36b4-6d56-4556-b524-9e3955b922c8@eisentraut.org> Date: Tue, 26 Nov 2024 10:12:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SQL:2023 JSON simplified accessor support To: Andrew Dunstan , Alexandra Wang , Nikita Glukhov Cc: PostgreSQL Hackers , "David E. Wheeler" , jian he References: Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 21.11.24 23:46, Andrew Dunstan wrote: >> Questions: >> >> 1. Since Nikita’s patches did not address the JSON data type, and JSON >> currently does not support subscripting, should we limit the initial >> feature set to JSONB dot-notation for now? In other words, if we aim >> to fully support JSON simplified accessors for the plain JSON type, >> should we handle support for plain JSON subscripting as a follow-up >> effort? >> >> 2. I have yet to have a more thorough review of Nikita’s patches. >> One area I am not familiar with is the hstore-related changes. How >> relevant is hstore to the JSON simplified accessor? >> > > We can't change the way the "->" operator works, as there could well be > uses of it in the field that rely on its current behaviour. But maybe we > could invent a new operator which is compliant with the standard > semantics for dot access, and call that. Then we'd get the best > performance, and also we might be able to implement it for the plain > JSON type. If that proves not possible we can think about not > implementing for plain JSON, but I'd rather not go there until we have to. Yes, I think writing a custom operator that is similar to "->" but has the required semantics is the best way forward. (Maybe it can be just a function?) > I don't think we should be including hstore changes here - we should > just be aiming at implementing the standard for JSON access. hstore > changes if any should be a separate feature. The aren't relevant to JSON > access, although they might use some of the same infrastructure, > depending on implementation. In a future version, the operator/function mentioned above could be a catalogued property of a type, similar to typsubscript. Then you could also apply this to other types. But let's leave that for later. If I understand it correctly, Nikita's patch uses the typsubscript support function to handle both bracket subscripting and dot notation. I'm not sure if it's right to mix these two together. Maybe I didn't understand that correctly.