Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMiNI-0004mt-IS for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2019 00:50:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iMiNF-00008r-JK for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2019 00:50:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMiNF-000073-7G for pgsql-hackers@lists.postgresql.org; Tue, 22 Oct 2019 00:50:09 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMiNC-0003gG-8h for pgsql-hackers@postgresql.org; Tue, 22 Oct 2019 00:50:08 +0000 Received: by mail-qt1-x842.google.com with SMTP id t20so24161796qtr.10 for ; Mon, 21 Oct 2019 17:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xECTryI6T9ZOkM6+tVX1miqZLkWRnwkkF1eK0J6MPWc=; b=gC9p2Ft6hiV+3/nPgRqPKz8h73piqc0AlEECi5WqQPH3yXq3ydTowRai0biui9HgvX gvPi4btOws+4j01nl/wUZoFZyLX4hdSHHUhrg1sbGg/EEFg2G1rrZEPHPTIqqNL4VLT+ G7xiTQXB/mz3lfwRKgf3da5DVEgRaVjZi6P3qBdnedjxi2PEUHlyotm7PaptSr9mf8gU Cl1p/9POpClHt+xjqPD24E4x3FJ6JgJFOeyu//s86fF2qDh00lHFCVfeHOnx5IHUcHOW b8EAM9tqqFcbPXafeFC5cIBuUZIUWlRF5JohvgH5LZc8md73a167AtLnbglHzXVRG1pc 0mXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xECTryI6T9ZOkM6+tVX1miqZLkWRnwkkF1eK0J6MPWc=; b=A4PHkfg6wH+jyGSaC05XsXFa2N76ujKNCkK+04MYHXDzjCLbjp7BkgI39GVupa2xqz x0jrAFYQwDpObTgBUqqD4BU1iXw9VFIwmISGB4evfW0VV4v5emxT9u9yYkRdCQDeJ7cZ JvTJFeEWf+p4ChO/cVR2UIHgKQuqEeKkhdLmrXmAofhX+xiho7mpVZWxgZ/x6F73mfz8 YX3cfSUbAy8X6BywkDG1YZpa3qvTaR8mO9MBMXJ7s0G3o2aK6rSzLUNGit6Rx7KA7TP/ zhUKiCsfXarojz3BAnmIRZxlSDJduCrm3cAn4XU55HxO8m5bhkrhZmLswm1zYLSFaqOD l7Iw== X-Gm-Message-State: APjAAAXQzw9b/rwOIi2IH7w9Tuz7Xw/0Dr0NspVMhQUglJ2v9ghfj3T8 d+sh2vmIntQSQi0yvcjNi5Y= X-Google-Smtp-Source: APXvYqzpiYNQqQkZIyzu52TP2X5HKEwGeo4B+o5D1AhYv5AsenYS7OaXtd0M5TGN+OHfYgk2DTCW/A== X-Received: by 2002:ac8:4241:: with SMTP id r1mr697369qtm.111.1571705403589; Mon, 21 Oct 2019 17:50:03 -0700 (PDT) Received: from [192.168.2.96] (c-73-201-119-74.hsd1.md.comcast.net. [73.201.119.74]) by smtp.gmail.com with ESMTPSA id 56sm18669986qty.15.2019.10.21.17.50.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Oct 2019 17:50:03 -0700 (PDT) Subject: Re: Re: SQL/JSON: functions To: Nikita Glukhov , PostgreSQL-development Cc: Alvaro Herrera , Thomas Munro , Andres Freund , Dmitry Dolgov <9erthalion6@gmail.com>, Pavel Stehule , Oleg Bartunov , Alexander Korotkov , Michael Paquier , Simon Riggs , Andrew Dunstan References: <20190925205515.GA26083@alvherre.pgsql> From: Andrew Alsup Message-ID: Date: Mon, 21 Oct 2019 20:50:02 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/21/19 12:44 PM, Nikita Glukhov wrote: > > v39 patch is based on 5ee96b3e2221d154ffcb719bd2dee1179c53f821 > > Use the following git command to apply patches: > > git am ~/Downloads/0001-Jsonpath-support-for-json-v39.patch > Thank you. The patch applied fine, with no errors. Is this the type of testing that would be helpful? I plan to construct a number of separate queries to test more nuanced edge cases. This test simply compares the output of 4 separate sub-queries that should provide the same results. SELECT   CASE WHEN jop = jp_expr AND jop = jval AND jop = jval_path     THEN 'pass'     ELSE 'fail'   END FROM   (     -- jsonb operator     SELECT count(*)     FROM testjsonb     WHERE j->>'abstract' LIKE 'A%'   ) as jop,   (     -- jsonpath expression     SELECT count(*)     FROM testjsonb     WHERE j @? '$.abstract ? (@ starts with "A")'   ) as jp_expr,   (     -- json_value()     SELECT count(*)     FROM testjsonb     WHERE JSON_VAlUE(j, 'lax $.abstract') LIKE 'A%'   ) as jval,   (     -- json_value(jsonpath)     SELECT count(*)     FROM testjsonb     WHERE JSON_VALUE(j, 'lax $.abstract ? (@ starts with "A")') IS NOT NULL   ) as jval_path; If I'm completely off base for how testing is normally conducted, please let me know. Thanks, Andrew Alsup