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 1rUJwv-00ABEo-B5 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 05:12:49 +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 1rUJwu-00BlHL-88 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 05:12:48 +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 1rUJwt-00BlHC-Uv for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 05:12:47 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUJwr-004HLE-LI for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 05:12:47 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3be6df6bc9bso66654b6e.0 for ; Sun, 28 Jan 2024 21:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706505164; x=1707109964; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=scioc+KxAm2oOUU7HudWndw2q+1Afx+OLG9ifeZ2ZTo=; b=H87R88gjgrnJuoQWAsyBmH5rcdcRlL0PI6wpfK9KfD7OUqWVaCZx5TED+nuZAIFiV6 QwCiw4223yDRUYPmMQUAmv/i37Ib6wHRUZSIFterf6GWOpxGyESYA1WCeZQV4yU34eno q8YqxMThrqvfYtm33CREx/OfYvwqy/Rh4p/1cmahaBrDWy0BEVhqIUOHTKGFRv00hWhO fsLy8UCYUUSylwzzEeRLN0Z5WrMCXr1EVXT62YvbPZzG/qHPZg5Rmm4S/uaZ/WvJJGJA +HyL65TOHrY6+BFFP0LovK9c89VJ8hZGVQ8cBGhlnSj7QIGAEyZMuDaYgxXQp8x/2se3 3yrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706505164; x=1707109964; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=scioc+KxAm2oOUU7HudWndw2q+1Afx+OLG9ifeZ2ZTo=; b=Tb9+sJ3x+NkhBqlfSPpqDR7Tiaz/R4XtOdX8rcFzqBwklRsIBjzXZDJ6wplzoFFnTd CkRzWZR5G63WaeFuZ87H8NRjiQm2KIvaxfCyf1za2PBLhT/1iD8DtepuNnmunJKJkGwo V41Tp959xBRh9PrWSNC2jcSjFSdegeFyR7wB4ymo/y/WLbwUtxOlz1j1kyivDtYKuqKu /T0wJQpSCVKPb0boAiMF2akHhY5u0LeGS57a9XNIQtQi3JEgDH/uRg7LPEzibgGGcDwR cFy0nk7FYB2apMkp7LrbNt1tjKtNS8wb1TrNRFMyNaRcGVukoEEyX7VUx41Plm/+FtIQ l4TA== X-Gm-Message-State: AOJu0YyAAtE3PS6CtP1wBMbEqSgpbRVB65ReMhVwqe+FKNT0OqI4LPgr r0jtJGHBLd0ewRKKC+T8iZg4J8Nxtt/zKyzGSygFRQ0sD7PcuEzT X-Google-Smtp-Source: AGHT+IFIirKHVDUBjVlJ2g3aLanfTjyuC04FN4zuVOPrhftJBRe+cAqzF14u3Gh8+Qs7GoECGPJ6fw== X-Received: by 2002:a05:6808:218c:b0:3be:1f50:6437 with SMTP id be12-20020a056808218c00b003be1f506437mr3914530oib.15.1706505163745; Sun, 28 Jan 2024 21:12:43 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id u33-20020a056a0009a100b006d9aaee2f57sm4950611pfg.102.2024.01.28.21.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 21:12:43 -0800 (PST) Date: Mon, 29 Jan 2024 14:12:40 +0900 (JST) Message-Id: <20240129.141240.1988354480093375317.horikyota.ntt@gmail.com> To: tgl@sss.pgh.pa.us Cc: jeevan.chalke@enterprisedb.com, andrew@dunslane.net, peter@eisentraut.org, pgsql-hackers@lists.postgresql.org Subject: Re: More new SQL/JSON item methods From: Kyotaro Horiguchi In-Reply-To: <1678192.1706500022@sss.pgh.pa.us> References: <20240129.121200.235012930453045390.horikyota.ntt@gmail.com> <1678192.1706500022@sss.pgh.pa.us> User-Agent: Mew version 6.8 on Emacs 27.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Sun, 28 Jan 2024 22:47:02 -0500, Tom Lane wrote in > Kyotaro Horiguchi writes: > > They seem to be suggesting that PostgreSQL has the types > "decimal" and > > "number". I know of the former, but I don't think PostgreSQL has > the > > latter type. Perhaps the "number" was intended to refer to > "numeric"? > > Probably. But I would write just "type numeric". We do not > generally > acknowledge "decimal" as a separate type, because for us it's only > an > alias for numeric (there is not a pg_type entry for it). > > Also, that leads to the thought that "numeric argument ... is out of > range for type numeric" seems either redundant or contradictory > depending on how you look at it. So I suggest wording like > > argument "...input string here..." of jsonpath item method .%s() is > out of range for type numeric > > > (And I think it is largely helpful if the given string were shown > in > > the error message, but it would be another issue.) > > Agreed, so I suggest the above. Having said that, I'm a bit concerned about the case where an overly long string is given there. However, considering that we already have "invalid input syntax for type xxx: %x" messages (including for the numeric), this concern might be unnecessary. Another concern is that the input value is already a numeric, not a string. This situation occurs when the input is NaN of +-Inf. Although numeric_out could be used, it might cause another error. Therefore, simply writing out as "argument NaN and Infinity.." would be better. Once we resolve these issues, another question arises regarding on of the messages. In the case of NaN of Infinity, the message will be as the follows: "argument NaN or Infinity of jsonpath item method .%s() is out of range for type numeric" This message appears quite strange and puzzling. I suspect that the intended message was somewhat different. > > The same commit has introduced the following set of messages: > > >> %s format is not recognized: "%s" > >> date format is not recognized: "%s" > >> time format is not recognized: "%s" > >> time_tz format is not recognized: "%s" > >> timestamp format is not recognized: "%s" > >> timestamp_tz format is not recognized: "%s" > > > I believe that the first line was intended to cover all the > others:p > > +1 regards. -- Kyotaro Horiguchi NTT Open Source Software Center