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 1lcJcU-0003rD-I9 for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Apr 2021 03:15: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 1lcJcT-0004MN-EF for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Apr 2021 03:15:09 +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 1lcJcT-0004MG-0L for pgsql-bugs@lists.postgresql.org; Fri, 30 Apr 2021 03:15:09 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lcJcQ-00069c-CG for pgsql-bugs@lists.postgresql.org; Fri, 30 Apr 2021 03:15:08 +0000 Received: by mail-pl1-x636.google.com with SMTP id s15so7449947plg.6 for ; Thu, 29 Apr 2021 20:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NZ6JGU7TQxkpa6mWWEK04cAZkTrOjFWBbw3QJkzydIY=; b=MFYeaOJ29N1g2yn3TiryXzyRay6sHMhlvt4Ucl+tYmPqBp5wfnNv7LHEvSbMUMEu4h 69uAg+jUiRjibl7VId1BPl6UsB2XfKEqi7lUK3Q540DlctAp3ZHxG6F49RXIMFo2Pf3y y/2LMNDPCZk8yDWx5DC4e4Jdt7RPNQdYO/Ucg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NZ6JGU7TQxkpa6mWWEK04cAZkTrOjFWBbw3QJkzydIY=; b=HW5liWQCrO5G4MP0PeoF96cr4I14tsIda82aUFISndj1SsmT9w7JlWPkT4RJ5ywref aZ0lD0sE3Jn7XEh2Shqk1YK7V2boFI4xn2nGK43Gc910CRfxpJv8mVyrmDiKbzN90UFC trRnI5CqAM2UwAlENpEd0s8LhnLQwtUPGza+CFZtFipFWNOIPe5GzNcLI0HOkOF5eiKm jx0IlOTVxRrMDA21EsDVm13Sep7PEcDqJOLBNUdG45n1F6ipoPXDamMQFdMowyjT8sG9 JDIPX02btxnvlbh+JT6XhX5nvoM7jQcsc6xMD41kDrRnqbdd2txo+7dGCXogM8c7LScq Ex7g== X-Gm-Message-State: AOAM532XC+l9VwDdXLLRSjiLBYATMJg7j1HujmkHroN+vEKLJhCZRAnf SYBaCiBJAcYcrjxODC2mDY1ECw== X-Google-Smtp-Source: ABdhPJz3bUs+HGOTbuQ2+JMxE1V9gMZNNXd9sQfvlOi+JvbKavc1HG7librbxAwOW3A2F06r3vN4OA== X-Received: by 2002:a17:90a:5d0a:: with SMTP id s10mr3143637pji.170.1619752504194; Thu, 29 Apr 2021 20:15:04 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id k69sm1466725pgc.45.2021.04.29.20.15.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Apr 2021 20:15:03 -0700 (PDT) Date: Thu, 29 Apr 2021 20:15:01 -0700 From: Noah Misch To: Bruce Momjian Cc: Tom Lane , neverov.max@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16939: Plural interval for negative singular Message-ID: <20210430031501.GA2591558@rfd.leadboat.com> References: <20210425115726.GA2353095@rfd.leadboat.com> <20210426163116.GR7629@momjian.us> <2266336.1619455534@sss.pgh.pa.us> <20210426165435.GT7629@momjian.us> <2267469.1619456564@sss.pgh.pa.us> <20210426170616.GV7629@momjian.us> <20210427061329.GB2435607@rfd.leadboat.com> <20210427201019.GY7629@momjian.us> <20210428054415.GA2493304@rfd.leadboat.com> <20210430010004.GA23068@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210430010004.GA23068@momjian.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 29, 2021 at 09:00:04PM -0400, Bruce Momjian wrote: > On Tue, Apr 27, 2021 at 10:44:15PM -0700, Noah Misch wrote: > > On Tue, Apr 27, 2021 at 04:10:19PM -0400, Bruce Momjian wrote: > > > Yes, I found the same like you did. Are you saying we should remove the > > > abs() calls here so we are consistent? > > > > No, I advise just reverting 5da9868. The output funcs should keep doing what > > they did in v13, inconsistency and all. > > > > I was asking the above question to see which of singular or plural was more > > common before $SUBJECT's commit. I count two examples of singular and seven > > examples of plural (one in EVALUATE_MESSAGE_PLURAL(), six modified in commit > > 5da9868). Given that, ... > > > > On Mon, Apr 26, 2021 at 01:06:16PM -0400, Bruce Momjian wrote: > > > Well, we should then add a comment that this is inconsistent but should > > > not be changed. > > > > ... adding comments to the two places that use abs() to achieve singular "-1" > > sounds fine. > > OK, first, I never realized that saying -1 plural was valid. Second, > the two places you showed are actually using abs() properly since > negative values are shown with an "ago" suffix, not a negative sign: > > SET intervalstyle = postgres_verbose; > > SELECT '2020-01-01 01:03:00'::timestamptz - '2020-01-01 02:02:01'::timestamptz; > ?column? > --------------------- > @ 59 mins 1 sec ago > (1 row) Nice. The legendary consistency of PostgreSQL remains intact. > Attached is a patch which reverts 9ee7d533da and 5da9868ed9, and adds a > comment about the "ago" usage. Looks good.