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 1lbczt-00035D-A1 for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Apr 2021 05:44:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lbczs-00060O-9D for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Apr 2021 05:44:28 +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 1lbczr-00060H-Rn for pgsql-bugs@lists.postgresql.org; Wed, 28 Apr 2021 05:44:28 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lbczl-0000Ur-F0 for pgsql-bugs@lists.postgresql.org; Wed, 28 Apr 2021 05:44:27 +0000 Received: by mail-pf1-x433.google.com with SMTP id y62so10335823pfg.4 for ; Tue, 27 Apr 2021 22:44:20 -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=osDrOj0+WHgrr74odAVQGWGzCCdmgjaV/Im9sHLOoXc=; b=CCro6D4WNhzodcO4a7bIht5dL3PPcws77Tv1Y7VBaqNeffHQ5lz427VWi/nLYjRWr4 XM1Fq1QcE/5D5lRSycD5rOKBpAAzsmlmK8oMNAgQv3CJlsFQULLQxLbdetnZ1RGiSw2z tEuAeoHK3yjnRjqCcKpO0WgyILLI8d7lkjFUc= 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=osDrOj0+WHgrr74odAVQGWGzCCdmgjaV/Im9sHLOoXc=; b=LlxOTzsLkg/cBVJgW3ALo+mhhtIOyF/nZK110GkgkBiw89XzTNOSr9NkwLigsFbaB4 MiA6cvhO58f5tHQuvw8fzykfUn7KPsPLJpRsinmMCV0RCebTSETnU3qzkk3KTqjPXqcH eUc367w1WpQJBx7YSP6dpnoSZP6RShn7dFQQH8Yull73b8enGNm8a2Fn7GPp5VUR68+L V1UsYIlMifqNOBhwdXVp7PVkvn80r6r7FeH3oRyL6q/GxbbSypUOJicnFXqDEfOuYvJa 8MX7+PEu8YdW8tokAHW9+TLRTqJ1KYCM/knD7kTKiQiI9TPDTsT5dbgSXoicevdQvA5I FFIQ== X-Gm-Message-State: AOAM531nLpPTcYPfvKGjriqKAxx/WPbgJNOZhhddrwfwogom2vSAN03h uU322GvT9RToizu/ILZ2aHD3dA== X-Google-Smtp-Source: ABdhPJzNTohYHtGgFAaJbFd0395wlxOWTmX6I3ysGjrkBuCD1Of0p4d7KAG7ZDPsN3TNM9SLtb8ZUg== X-Received: by 2002:a62:7ace:0:b029:25e:fcfc:4873 with SMTP id v197-20020a627ace0000b029025efcfc4873mr26470193pfc.4.1619588659020; Tue, 27 Apr 2021 22:44:19 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id z5sm4060486pff.191.2021.04.27.22.44.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Apr 2021 22:44:18 -0700 (PDT) Date: Tue, 27 Apr 2021 22:44:15 -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: <20210428054415.GA2493304@rfd.leadboat.com> References: <16939-cceeb03fb72736ee@postgresql.org> <20210323160336.GE579@momjian.us> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427201019.GY7629@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 Tue, Apr 27, 2021 at 04:10:19PM -0400, Bruce Momjian wrote: > On Mon, Apr 26, 2021 at 11:13:29PM -0700, Noah Misch wrote: > > On Mon, Apr 26, 2021 at 01:06:16PM -0400, Bruce Momjian wrote: > > > On Mon, Apr 26, 2021 at 01:02:44PM -0400, Tom Lane wrote: > > > > Bruce Momjian writes: > > > > > On Mon, Apr 26, 2021 at 12:45:34PM -0400, Tom Lane wrote: > > > > >> I agree with Noah's opinion that we should stick to the historical > > > > >> behavior in the interval I/O functions. There is not enough solidity > > > > >> in the "this is grammatically wrong" argument to justify taking any > > > > >> risk of application breakage, and it seems like there is some risk of > > > > >> that there. > > > > > > > > > Are you saying we should revert the patch and leave the plurals > > > > > inconsistent in different places? We were already expressing -1 as > > > > > singular in most of the places I saw. > > > > Which places did you find? I used the following to check for code like you > > were adding, but it probably missed things: > > > > $ git grep '"s"' 5da9868^ | grep abs > > 5da9868^:src/backend/utils/adt/datetime.c: (abs(sec) != 1 || fsec != 0) ? "s" : ""); > > 5da9868^:src/interfaces/ecpg/pgtypeslib/interval.c: (abs(sec) != 1 || fsec != 0) ? "s" : ""); > > 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.