Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebupe-0000nN-1a for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jan 2018 21:01:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebupd-0000Yo-9U for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jan 2018 21:01:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ebupc-0000Ye-Sa for pgsql-hackers@lists.postgresql.org; Wed, 17 Jan 2018 21:01:13 +0000 Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ebupZ-00083S-Ud for pgsql-hackers@postgresql.org; Wed, 17 Jan 2018 21:01:11 +0000 Received: by mail-yw0-x243.google.com with SMTP id v139so9444208ywg.4 for ; Wed, 17 Jan 2018 13:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=gqsb1d6r09JU4vPDnKmKKWOtWN/rCuSAIEzfdQ3K9tw=; b=jwTL3jidEwluEuTuJCJf3pw1jAOYeB07dhPJwMNi987Wpxkmon7n1NJBPGlbBouopx XjqMJWr0o/OTVHWNffnW7pjSb4BjlHmyCXqbPdTX9sBHzJI8kFzLk4fMxv0lvDF5FVid /utp1eADvRiIwg6pIRYzfKJHDUthkC875tfgrSx8pBkHIBFRFTpO8NLwjiNTEDB6LWw7 tmN57KLQGdyivXWA9HcMB4o5gedQ3+jFL5qGcUY6ivvUa0/GVjwzRvU/QcQG86FANpLo pWeNx+VDmhUIEht8ySv3YPeiGGmEzYt5oQD6I7Fa79mz8H+WwHkoQ8nmmNqB49fclpSx LzoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=gqsb1d6r09JU4vPDnKmKKWOtWN/rCuSAIEzfdQ3K9tw=; b=cKJcSDUPbwbjFNO7+qC7R/n2uc2yOktHHVCrpMEOSHqImorsk55Psp3YVtVEYbvGRW brBpLc3ncFGZTB48+ecrw6CwkACiunb3RxZpTTJFmrN3XpVwl+sbcNPj3O6eK7cm6L07 vDaZ2FP3/4pF2xf68qpBSWypVBEJaSus7DLkl7d+kAiXAmCbp2Lo5lxop2ScF8XyNOVh tTjq24bwEbNn5uj2YqPxOrFxWJm1dAv2Xsk7quJiUHuOW9DRHCRqxPIWYbEzxnONUnuq i4zLpeYfLy2anpWYKdKS9RFfp4hl/3JWrK1IY08ofRdOncxV08g4eYqcZaxMQoDeuHEM WoQg== X-Gm-Message-State: AKwxytfqH+ANWh3iULkuNt/0sIUsTEm5qSdvMtbEs9SUXN0MJCXpI+lx 8nOC+VWS9agPpQaIsIphpttMIjNAhg== X-Google-Smtp-Source: ACJfBoueNqhJT7WKHtF9pFsNkuUmIu+dsM9wwFmYZVORJrDQ4q/eTCWRlreQlu8MsX26peAGa0O0YQ== X-Received: by 10.13.253.131 with SMTP id n125mr3840520ywf.129.1516222868838; Wed, 17 Jan 2018 13:01:08 -0800 (PST) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id w69sm2208540yww.13.2018.01.17.13.01.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 13:01:08 -0800 (PST) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: jsonpath To: Nikita Glukhov , Pavel Stehule Cc: PostgreSQL-development , Oleg Bartunov References: <9f845926-0d7d-7c4d-75e3-b1e921a1677a@2ndQuadrant.com> <48f13b75-0be7-c356-ff26-1db743add56e@postgrespro.ru> <7b4b8973-43f5-71c5-bf86-51cb5798dd88@2ndQuadrant.com> Message-ID: Date: Wed, 17 Jan 2018 16:01:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <7b4b8973-43f5-71c5-bf86-51cb5798dd88@2ndQuadrant.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 01/15/2018 07:24 PM, Andrew Dunstan wrote: > > On 01/10/2018 05:42 PM, Nikita Glukhov wrote: >> Attached new 8th version of jsonpath related patches. Complete >> documentation is still missing. >> >> The first 4 small patches are necessary datetime handling in jsonpath: >> 1. simple refactoring, extracted function that will be used later in >> jsonpath >> 2. throw an error when the input or format string contains trailing >> elements >> 3. avoid unnecessary cstring to text conversions >> 4. add function for automatic datetime type recognition by the >> presence of formatting components >> >> Should they be posted in a separate thread? >> > > The first of these refactors the json/jsonb timestamp formatting into a > single function, removing a lot of code duplication. The involves > exposing time2tm() and timetz2tm(). I don't think that's a tragedy, so > unless there is any objection I propose to commit it shortly. > > The next three expose a bit more of the date/time API. I'm still > reviewing those. > I have committed the first of these patches. I have reviewed the next three, and I think they are generally good. There is no real point in committing them ahead of the jsonpath patch since there would be no point in having them at all but for that patch. Note that these do export the following hitherto internal bits of the datetime functionality: tm2time tm2timetz AdjustTimeForTypmod AdjustTimestampForTypmod Moving on to review the main jsonpath patch. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services