pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ryan Kelly <rpkelly22@gmail.com>
Cc: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: afonit@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
Date: Mon, 07 Jan 2013 13:06:55 -0500
Message-ID: <13442.1357582015@sss.pgh.pa.us> (raw)
In-Reply-To: <20130107174726.GB18868@llserver.lakeliving.com>
References: <E1TsDhv-00040y-0S@wrigleys.postgresql.org>
	<20130107171915.GA18868@llserver.lakeliving.com>
	<CA+mi_8bbtcvG6n9gm7EAnh5KNb=nJMjqg8prn=DhzLh0RX5Acw@mail.gmail.com>
	<20130107174726.GB18868@llserver.lakeliving.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Ryan Kelly <rpkelly22@gmail.com> writes:
> On Mon, Jan 01/07/13, 2013 at 05:42:40PM +0000, Daniele Varrazzo wrote:
>> On Mon, Jan 7, 2013 at 5:19 PM, Ryan Kelly <rpkelly22@gmail.com> wrote:
>>> '1 month'::interval is the same as '30 days'::interval.

>> No, it's not.

> Alright, now I'm thoroughly confused. What magic makes this true:
> # select '30 days'::interval = '1 month'::interval;
>  ?column? 
> ----------
>  t

'1 month' and '30 days' are distinct concepts.  Some operations will
treat them as equal, if there is no additional info that will nail
down the actual length of the particular month in question.  Or if
you like, 30 days is the "default" length of a month.

A related point is that the interval equality operator will say that
'24 hours' and '1 day' are equal, even though they aren't the same
thing --- there are cases where they behave differently, when working
near a DST transition time.

There might be some use for an interval "identity" operator, which would
only say true for completely-indistinguishable interval values; but we
don't have one.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)

Message-ID: <13442.1357582015@sss.pgh.pa.us>
Permalink:  ../13442.1357582015@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13442.1357582015@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rpkelly22@gmail.com, daniele.varrazzo@gmail.com, afonit@gmail.com
  Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
  In-Reply-To: <13442.1357582015@sss.pgh.pa.us>
  References: <E1TsDhv-00040y-0S@wrigleys.postgresql.org> <20130107171915.GA18868@llserver.lakeliving.com> <CA+mi_8bbtcvG6n9gm7EAnh5KNb=nJMjqg8prn=DhzLh0RX5Acw@mail.gmail.com> <20130107174726.GB18868@llserver.lakeliving.com> <13442.1357582015@sss.pgh.pa.us>

* 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