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 1rhMYn-00B4eW-Hh for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Mar 2024 04:37: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 1rhMYj-00DNlB-RA for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Mar 2024 04:37:46 +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 1rhMYj-00DNl3-Hu for pgsql-hackers@lists.postgresql.org; Tue, 05 Mar 2024 04:37:46 +0000 Received: from m16.mail.163.com ([117.135.210.3]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rhMYY-002plv-9L for pgsql-hackers@lists.postgresql.org; Tue, 05 Mar 2024 04:37:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=wWj/np/kFZzIXoFZ77etwPfeCm8PAOactZSuUOTR80g=; b=ehfg6AIyGJBZeJRdJKG/iWw3tM5HbBc3nLqLI644waO2K8+f1xgPJQ7Y9b5hrH b1EvOCLTZ22SYmF2hZhlpwGt8a69vVEl4uG5AQCYGhjeC/wZPlw0CAdQWJxtqUcs ThgjCPgJYQAOsjjRFaf4w8MRGnQm23+RgsLoMTgSAXvKY= Received: from 8235eee8a2a0 (unknown [140.205.118.252]) by gzga-smtp-mta-g2-2 (Coremail) with SMTP id _____wDXLsRboeZllPauAQ--.18069S3; Tue, 05 Mar 2024 12:36:44 +0800 (CST) References: <1cee81f3-312f-30e3-0282-c4df7ee72f93@xs4all.nl> <202403041503.5momp6knupgo@alvherre.pgsql> User-agent: mu4e 1.10.7; emacs 29.1 From: Andy Fan To: Amit Langote Cc: Alvaro Herrera , Erik Rijkers , jian he , Andres Freund , Andrew Dunstan , PostgreSQL-development , pgsql-hackers@lists.postgresql.org, Peter Eisentraut Subject: Re: remaining sql/json patches Date: Tue, 05 Mar 2024 12:28:32 +0800 In-reply-to: Message-ID: <87plw9b8h0.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID:_____wDXLsRboeZllPauAQ--.18069S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Cr1UAFWDGryDGw4kWw1rJFb_yoW8XFW7pr W5K3Z0krWkXFyIvwnFg3WrA3W0kw4fGa18Jr1DJry8Xa15uFyjqFWIva1Yga4qkw1rKa1x XF4Ygw17Zw1qvaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zReHqsUUUUU= X-Originating-IP: [140.205.118.252] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/xtbBzwCYU2V4IEsGlgAAsi List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, > On Tue, Mar 5, 2024 at 12:03=E2=80=AFAM Alvaro Herrera wrote: >> On 2024-Mar-04, Erik Rijkers wrote: >> >> > In my hands (applying with patch), the patches, esp. 0001, do not appl= y. >> > But I see the cfbot builds without problem so maybe just ignore these = FAILED >> > lines. Better get them merged - so I can test there... >> >> It's because of dbbca2cf299b. It should apply cleanly if you do "git >> checkout dbbca2cf299b^" first ... That commit is so recent that >> evidently the cfbot hasn't had a chance to try this patch again since it >> went in, which is why it's still green. > > Thanks for the heads up. Attaching rebased patches. In the commit message of 0001, we have: """ Both JSON_VALUE() and JSON_QUERY() functions have options for handling EMPTY and ERROR conditions, which can be used to specify the behavior when no values are matched and when an error occurs during evaluation, respectively. All of these functions only operate on jsonb values. The workaround for now is to cast the argument to jsonb. """ which is not clear for me why we introduce JSON_VALUE() function, is it for handling EMPTY or ERROR conditions? I think the existing cast workaround have a similar capacity? Then I think if it is introduced as a performance improvement like [1], then the test at [1] might be interesting. If this is the case, the method in [1] can avoid the user to modify these queries for the using the new function.=20 [1] https://www.postgresql.org/message-id/8734t6c5rh.fsf@163.com --=20 Best Regards Andy Fan