Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjQLa-0001NQ-4A for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Apr 2023 20:00:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjQLY-0003Nq-LD for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Apr 2023 20:00:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjQLY-0003Nh-95 for pgsql-hackers@lists.postgresql.org; Mon, 03 Apr 2023 20:00:08 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pjQLU-000h15-TQ for pgsql-hackers@postgresql.org; Mon, 03 Apr 2023 20:00:07 +0000 Received: by mail-lj1-x22c.google.com with SMTP id s20so11271236ljp.7 for ; Mon, 03 Apr 2023 13:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680552003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oU0b6GksntaKRgefnQ3Wwn55bvrmPOLoUmAwqvV4MbE=; b=iX6YyQYjqStCPV3SVDkvbXeaA4ci5ohMarvy5WxJICktqXc+RAtmLjDzzyO7ouM22p gvDTI9bLNtVPeRfxDHJXyHTTCMOwdGCXAArWgx9YHWZ/eVEHEkWkUW6lQv/d/zSIBQAs 3AjstTA+Dhu9NefUJzvWE3g2XLlQuZv1Ew9ViAkemUyPSRwQuvFcdbEhlbJsUgpQVHsx BtOF0dtEyeWq4Qz8Eh0x161lMMnMa9Zl34wyW6CebKi1Ik37e4myaqNMxutm6zmMBe+z PS8MBaRZcQdn8lUMyd+yMAiYeA4djtHozKrmBcP9PVAB/eujFPKGKW6QILbna8/pff8M wGqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680552003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oU0b6GksntaKRgefnQ3Wwn55bvrmPOLoUmAwqvV4MbE=; b=ERP7H+RONGmQxPKpdfcZOHldx4T6i2nasDpygRpmtprSGWirRMz33/guJtW2ykanEZ WItJkcdKArG8cgT5ghFka73ZMyn3xwmFF2j/zEzhmbBMtA48AQwqPtrKPcvXerZYxC2S Nv9vEo/CWIwaelkrToGdPUn6qhzwCrwxrz8L1dybDnf59KpMNqDbjzPnPIrS+5Q5Edbu 3ebZcVajaxcmniWuGQXp+ITXUaQBJkO4OoUsPsr+L/RlssnVm82UvEKsojea8HnNGnJ2 Lw1QCCEwAKAkphxUNyUrk/IFvAtHxxaUKoZtlWdwU2lNMytK4sMgEc6On4H3Km6yPLaE fsvg== X-Gm-Message-State: AAQBX9dXkyt4fh2QkjUDbSjhR96UyqlY4okC/mSW1p4e5c+FiJeckwoC nzrqWvCSqLHEdZWSG4+tB+M= X-Google-Smtp-Source: AKy350ZPdjLjUCbMcuh8nA1MzpCtAPWXgHy6CFpT9F7J7nrChMoTRKQbJhjLGyxoGcNkDDL7cuXh/Q== X-Received: by 2002:a2e:82ce:0:b0:29b:6fcf:d2e8 with SMTP id n14-20020a2e82ce000000b0029b6fcfd2e8mr174709ljh.53.1680552002769; Mon, 03 Apr 2023 13:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.30.94]) by smtp.gmail.com with ESMTPSA id l14-20020a2e99ce000000b0029f7d27b78bsm1913564ljj.110.2023.04.03.13.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Apr 2023 13:00:02 -0700 (PDT) Message-ID: <4b3cb6d0-d22b-2ae3-792c-9042f3dda2d9@gmail.com> Date: Mon, 3 Apr 2023 23:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: SQL/JSON revisited Content-Language: en-US To: Alvaro Herrera Cc: Erik Rijkers , Andrew Dunstan , Amit Langote , Peter Eisentraut , Andres Freund , vignesh C , PostgreSQL-development , e.indrupskaya@postgrespro.ru References: <20230403171647.5xonog3myjdgnad7@alvherre.pgsql> From: Alexander Lakhin In-Reply-To: <20230403171647.5xonog3myjdgnad7@alvherre.pgsql> 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 Hi Alvaro, 03.04.2023 20:16, Alvaro Herrera wrote: > So I pushed 0001 on Friday, and here are 0002 (which I intend to push > shortly, since it shouldn't be controversial) and the "JSON query > functions" patch as 0003. After looking at it some more, I think there > are some things that need to be addressed by one of the authors: > > - the gram.y solution to the "ON ERROR/ON EMPTY" clauses is quite ugly. > I think we could make that stuff use something similar to > ConstraintAttributeSpec with an accompanying post-processing function. > That would reduce the number of ad-hoc hacks, which seem excessive. > > - the changes in formatting.h have no explanation whatsoever. At the > very least, the new function should have a comment in the .c file. > (And why is it at end of file? I bet there's a better location) > > - some nasty hacks are being used in the ECPG grammar with no tests at > all. It's easy to add a few lines to the .pgc file I added in prior > commits. > > - Some functions in jsonfuncs.c have changed from throwing hard errors > into soft ones. I think this deserves more commentary. > > - func.sgml: The new functions are documented in a separate table for no > reason that I can see. Needs to be merged into one of the existing > tables. I didn't actually review the docs. Please take a look at the following minor issues in v15-0002-SQL-JSON-query-functions.patch: 1) s/addreess/address/ 2) ECPGColLabelCommon gone with 83f1c7b74, but is still mentioned in ecpg.trailer. 3) s/ExecEvalJsonCoercion/ExecEvalJsonExprCoercion/ ? (there is no ExecEvalJsonCoercion() function) 4) json_table mentioned in func.sgml:    details the SQL/JSON    functions that can be used to query JSON data, except    for json_table. but if JSON_TABLE not going to be committed in v16, maybe remove that reference to it. There is also a reference to JSON_TABLE in src/backend/parser/README: parse_jsontable.c handle JSON_TABLE (It was added with 9853bf6ab and survived the revert of SQL JSON last year somehow.) Best regards, Alexander