pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: neverov.max@gmail.com
Subject: BUG #16939: Plural interval for negative singular
Date: Tue, 23 Mar 2021 05:21:30 +0000
Message-ID: <16939-cceeb03fb72736ee@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16939
Logged by:          Max Neverov
Email address:      neverov.max@gmail.com
PostgreSQL version: 13.2
Operating system:   alpine
Description:        

Execute the query:
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.



view thread (20+ messages)  latest in thread

Message-ID: <16939-cceeb03fb72736ee@postgresql.org>
Permalink:  ../16939-cceeb03fb72736ee@postgresql.org/
Also on:    postgresql.org/message-id/16939-cceeb03fb72736ee@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, neverov.max@gmail.com
  Subject: Re: BUG #16939: Plural interval for negative singular
  In-Reply-To: <16939-cceeb03fb72736ee@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox