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 1soKSv-00ALQE-CL for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 10:20:50 +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 1soKSu-00ELVW-Pu for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 10:20:48 +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 1soKSu-00ELUT-Eb for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 10:20:48 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1soKSr-000c4d-BL for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 10:20:47 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2557311402AE; Wed, 11 Sep 2024 06:20:44 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 11 Sep 2024 06:20:44 -0400 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=1726050044; x=1726136444; bh=NMl/7/kF5ADAjYDCL4PGkkzBkj5LvgzK yMaseYabExY=; b=VGptt2BFQC88mRO5MUv4Lf1rfjVnqhH6aZMio5hMXBMganXF 2UVPDxgFNTCkjmI4zk8CAfONzpm3H2QIM2S8dkKcenFllwGkN8M7tt1VGRbzBk2E dnIKLyJ8TJfPmcZgf9hio6/dbLAjKcGE1H4C+/0VcLqqYlBSR3oTi+3CIXQElha0 YcwtVaOrOoz2LhSQ2wiMZ7ewuqOZCCZM1VaJ22IVu4rUiBXANHGFjepXrG2WtpWv qf8+Ts7otD65c4AgSaSVy+XgR4y3AQCi9VP1LiMhaP9s4Y/uRARgsdClghn/FNHN GOwiO3c10lkDM8g1D1A64jCNMa5721hbJUzK9w== 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=fm1; t=1726050044; x= 1726136444; bh=NMl/7/kF5ADAjYDCL4PGkkzBkj5LvgzKyMaseYabExY=; b=E LC7slgkfyW4Znfjit64R0dseEvgNgS9511Z+n55tjSJVSgkSV8cUZ1P3a31H4X51 zhXUD12S0EiKGOY2AzcAb1Cc7uVTGJqCV95w6M5ckFdwHs/yhUTgl5Z8Bp2zreBv 6v5+M6iglXddENx2x/UHLAMxyzB6ekIDwmq8N+5056ooOSJKsU5R9kObHS4fDYAj NSnXu0jBNxPrcz0/5fQcPLNIohFtXrda29H7oOLjt1ZWSfD95dCse1da/07Tc2aY hUuzgO7/nVaAcvuvmdyrn7Tu11hg0iIxDUDaAeMBogqd5C0VjFiiGv4QTiWoaTTr pZud/Som6NWCREn2ApCLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejuddgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepjefhveehtdetgfffhffhfeef gffghffflefgieeuueekhedvhedvfeehffdvfeeunecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdho rhhgpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope htghhlsehsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtohepuggrvhhiugesjhhushht rghthhgvohhrhidrtghomhdprhgtphhtthhopehjihgrnhdruhhnihhvvghrshgrlhhith ihsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhi shhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Sep 2024 06:20:42 -0400 (EDT) Message-ID: <5e8879d0-a3c8-4be2-950f-d83aa2af953a@eisentraut.org> Date: Wed, 11 Sep 2024 12:20:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Document DateStyle effect on jsonpath string() To: Tom Lane Cc: "David E. Wheeler" , jian he , PostgreSQL Hackers References: <56955B33-6959-4FDA-A459-F00363ECDFEE@justatheory.com> <4D874C72-8939-4083-8336-AB114D9E29AD@justatheory.com> <3541398.1725994308@sss.pgh.pa.us> <3654686.1725999372@sss.pgh.pa.us> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <3654686.1725999372@sss.pgh.pa.us> 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 10.09.24 22:16, Tom Lane wrote: > Peter Eisentraut writes: >> These JSON path functions are specified by the SQL standard, so they >> shouldn't depend on PostgreSQL-specific settings. At least in new >> functionality we should avoid that, no? > > Hmm ... but does the standard precisely define the output format? > > Since these conversions are built on our own timestamp I/O code, > I rather imagine there is quite a lot of behavior there that's > not to be found in the standard. That doesn't really trouble > me as long as the spec's behavior is a subset of it (i.e., > reachable as long as you've got the right parameter settings). Actually, the standard prohibits this call: """ XV) If JM specifies string, then: 1) Forallj,1(one)≤j≤n, Case: a) If Ij is not a character string, number, or Boolean value, then let ST be data exception — non-string SQL/JSON item (2202X). b) Otherwise, let X be an SQL variable whose value is Ij. Let ML be an implementation-defined (IL006) maximum length of variable-length character strings. Let Vj be the result of CAST (X AS CHARACTER VARYING(ML) If this conversion results in an exception condition, then let ST be that exception condition. """ So I guess we have extended this and the current behavior is consistent with item b). What I'm concerned about is that this makes the behavior of JSON_QUERY non-immutable. Maybe there are other reasons for it to be non-immutable, in which case this isn't important. But it might be worth avoiding that?