pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Allan Engelhardt <allane@cybaea.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Re: Data type confusion
Date: Sun, 05 Aug 2001 20:31:41 -0400
Message-ID: <7596.997057901@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.30.0108060157170.11162-100000@peter.localdomain>
References: <Pine.LNX.4.30.0108060157170.11162-100000@peter.localdomain>

Peter Eisentraut <peter_e@gmx.net> writes:
> One day we will have to accept the fact that months and seconds must not
> be mixed, period.  You can have year/month intervals or
> day/hour/minute/second intervals, not a combination.  An interval of '5
> years 3 minutes' has no meaning with the natural calendar rules.

I don't agree --- five years and three minutes is perfectly meaningful.
There are only certain things you can validly do with it, however, and
scaling by a floating-point number isn't one of them, because fractional
months aren't well-defined.  But you can, for example, add it to or
subtract it from a timestamp to produce a well-defined result timestamp.

The real bogosity in the interval type is that months and seconds are
not sufficient: it should be months, days, and seconds.  As we get
reminded twice a year by the regression tests, "1 day" and "24 hours"
are not the same thing.

			regards, tom lane



view thread (19+ messages)  latest in thread

Message-ID: <7596.997057901@sss.pgh.pa.us>
Permalink:  ../7596.997057901@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7596.997057901@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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, allane@cybaea.com, josh@agliodbs.com
  Subject: Re: Re: Data type confusion
  In-Reply-To: <7596.997057901@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