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 1ladOK-0007Dz-Ic for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Apr 2021 11:57:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ladOJ-0001Tj-EK for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Apr 2021 11:57:35 +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 1ladOJ-0001Tc-7u for pgsql-bugs@lists.postgresql.org; Sun, 25 Apr 2021 11:57:35 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ladOG-0002ZW-Se for pgsql-bugs@lists.postgresql.org; Sun, 25 Apr 2021 11:57:34 +0000 Received: by mail-pf1-x430.google.com with SMTP id d124so37086367pfa.13 for ; Sun, 25 Apr 2021 04:57:32 -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=8v3gqQtEE8P8miPfieNnEYw8bga6mYceR9AgXG/JmI0=; b=Pq69V74TkXN+yn//8OtsMcd18C33LAg04miMeaope/d5bSbAjSOsvIOmhwfdKEsGMy IdrTuNwQyNLdSMzRar51/rSWMNpsQsprDjb6c2LGzJpPD/9bgdysptulk4dtBr5r/dYg TrfGG9RsveVPsoiuf9bUDnaz0b1eL+/3HkoIo= 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=8v3gqQtEE8P8miPfieNnEYw8bga6mYceR9AgXG/JmI0=; b=Y0XxaZorHT2RhoUtsAzg65y7oeSBiCp1YOprdbI6zqqcy7FY6ptItjAvNO6+nIXRfR wS+CKczmqkyXOE3QEFR0MD1onPMctkh58wIJy6UM2UtyCSwI8LhbdVSDzBfTsk1sG1UX 7lbPU21nxAD7yOFx2s3uC3sAmP+i4LCxwlx75XdqjcoHqJSdqfzNBXTOd+33TGfy5fPg 1RuYl4h8xK26lWJyD+ehGedHQO7o7Cb23Dp0NcqDKKCjDlNOYjoF4PahDeiu7B2qlSFH lLIXL+maQiPtggeJ5oCD0EbYkhx+ry/K0iS2CybCnUbrKUMqDi5YmCF7ILak9e1dSOLM WvOg== X-Gm-Message-State: AOAM530zs6LPVTslpFV9FPiWHbuYWZl5btPon2hbFjUwiUntFsLVhuGT iLBl/QFgmCtuKiqlPocKJ1tOOg== X-Google-Smtp-Source: ABdhPJzKZ5/1Ab3W4unXf96WJitO6qT6ulxdeAYWOjvzF8edl6ulj0YU4Qp8JGjowoY3H0BIie2PGw== X-Received: by 2002:a65:5a8f:: with SMTP id c15mr742930pgt.0.1619351849791; Sun, 25 Apr 2021 04:57:29 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id j12sm9934388pfc.17.2021.04.25.04.57.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Apr 2021 04:57:29 -0700 (PDT) Date: Sun, 25 Apr 2021 04:57:26 -0700 From: Noah Misch To: Bruce Momjian Cc: neverov.max@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16939: Plural interval for negative singular Message-ID: <20210425115726.GA2353095@rfd.leadboat.com> References: <16939-cceeb03fb72736ee@postgresql.org> <20210323160336.GE579@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323160336.GE579@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, Mar 23, 2021 at 12:03:36PM -0400, Bruce Momjian wrote: > On Tue, Mar 23, 2021 at 05:21:30AM +0000, PG Bug reporting form wrote: > > postgres=# set intervalstyle='postgres'; > > SET > > postgres=# select interval '-1 year -1 day'; > > interval > > ------------------ > > -1 years -1 days > > (1 row) > > > > Expected output: > > -1 year -1 day > > > > The code > > (https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/datetime.c#L4193) > > pluralizes a time unit if the value is not 1, should check both -1 and 1.