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 1qojFJ-002bgs-No for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2023 11:43:53 +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 1qojFG-00669D-6D for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2023 11:43:51 +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 1qojFF-006694-Rw for pgsql-hackers@lists.postgresql.org; Fri, 06 Oct 2023 11:43:50 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qojFE-000Izv-6C for pgsql-hackers@lists.postgresql.org; Fri, 06 Oct 2023 11:43:49 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7878D5C0209; Fri, 6 Oct 2023 07:43:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 06 Oct 2023 07:43:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=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:sender:subject:subject:to:to; s=fm1; t= 1696592626; x=1696679026; bh=MuAq9YHOGFKtP/ecLN9Bh5fGM+i1DeuS1dJ pfHJm3D0=; b=puHLOCTSdXJtoR+b3ufWkhFcZblYhm529nwy3IawSLo2FOp0m2a DaKlYVA1BJ2ikeHr4+gEIkSdazwusGdIZHO1pHVUj6ua/VNUYjzUWjXLbI/uudY1 4vHM3DAGMqqJTDQXVDZbAJKtrvNpmTI5EeRoRtPf9ZGjZBxJbmYJsHfiLXSh35jn ON5AkaM0SlL4HL08u4OBd4zauxdoNfHKyvDU4m55C2ZmIZrqVQV1nh2rTW37wmZm r5UjEboozAhJ+L+eC12+GVSda6Xz3KubCQorRvxIiYs8qo/jSzcnD++Ei//JGQ+Y C86cAsUjAQamEDKoL95Kt4nLk2QI4LkefEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1696592626; x= 1696679026; bh=MuAq9YHOGFKtP/ecLN9Bh5fGM+i1DeuS1dJpfHJm3D0=; b=Z HqMQOqxXC7Dqg1DRI6NIf5fX6y2u0rvZiaR92DD4Z6VcVGBqr5Mur3rwgWykwOr/ q1GKLvMLngVotkADesq9EOE/+YV826dBAZhtR56d/tzRKD+bJcW9NKL3r9LW0ib4 SKwpuRFWywdH/KvMVmSjEPHuwhwkHPRimpI3jWLUMtCODUrBIaHWVWbtNdJuKOoc ULc+4hv/nsdk71yQcVcD0kT9gFfbFYejLXPVxhVT96YBoCPx9kpb4Ti+gGq0nQkN SV7WnjPpisvWnyjXOPG4OX6AJQtY+sdaX7b2xZmMVQCdEI5HV9NQtp6h1cAHUbR2 491vcpvWksMv7jQtEuK1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrgeeigdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgheqne cuggftrfgrthhtvghrnhepleeigfetvddugeeijefggedvvefgteehteetuddvffetjefg leejvdfhheekheetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 6 Oct 2023 07:43:45 -0400 (EDT) Message-ID: <6d4feb29-6ced-a7b0-2c15-42d3e8e201f7@eisentraut.org> Date: Fri, 6 Oct 2023 13:43:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: More new SQL/JSON item methods Content-Language: en-US To: Jeevan Chalke , PostgreSQL Hackers References: 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 29.08.23 09:05, Jeevan Chalke wrote: > v1-0001-Implement-jsonpath-.bigint-.integer-and-.number-m.patch > > This commit implements jsonpath .bigint(), .integer(), and .number() > methods.  The JSON string or a numeric value is converted to the > bigint, int4, and numeric type representation. A comment that applies to all of these: These add various keywords, switch cases, documentation entries in some order. Are we happy with that? Should we try to reorder all of that for better maintainability or readability? > v1-0002-Implement-.date-.time-.time_tz-.timestamp-and-.ti.patch > > This commit implements jsonpath .date(), .time(), .time_tz(), > .timestamp(), .timestamp_tz() methods.  The JSON string representing > a valid date/time is converted to the specific date or time type > representation. > > The changes use the infrastructure of the .datetime() method and > perform the datatype conversion as appropriate.  All these methods > accept no argument and use ISO datetime formats. These should accept an optional precision argument. Did you plan to add that? > v1-0003-Implement-jsonpath-.boolean-and-.string-methods.patch > > This commit implements jsonpath .boolean() and .string() methods. This contains a compiler warning: ../src/backend/utils/adt/jsonpath_exec.c: In function 'executeItemOptUnwrapTarget': ../src/backend/utils/adt/jsonpath_exec.c:1162:86: error: 'tmp' may be used uninitialized [-Werror=maybe-uninitialized] > v1-0004-Implement-jasonpath-.decimal-precision-scale-meth.patch > > This commit implements jsonpath .decimal() method with optional > precision and scale.  If precision and scale are provided, then > it is converted to the equivalent numerictypmod and applied to the > numeric number. This also contains compiler warnings: ../src/backend/utils/adt/jsonpath_exec.c: In function 'executeItemOptUnwrapTarget': ../src/backend/utils/adt/jsonpath_exec.c:1403:53: error: declaration of 'numstr' shadows a previous local [-Werror=shadow=compatible-local] ../src/backend/utils/adt/jsonpath_exec.c:1442:54: error: declaration of 'elem' shadows a previous local [-Werror=shadow=compatible-local] There is a typo in the commit message: "Implement jasonpath" Any reason this patch is separate from 0002? Isn't number() and decimal() pretty similar? You could also update src/backend/catalog/sql_features.txt in each patch (features T865 through T878).