pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Achilleas Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-admin@postgresql.org, Julius Tuskenis <julius@nsoft.lt>
Subject: Re: how to get a number of seconds in some interval ?
Date: Tue, 13 May 2008 10:15:27 -0400
Message-ID: <24656.1210688127@sss.pgh.pa.us> (raw)
In-Reply-To: <200805130956.51872.achill@matrix.gatewaynet.com>
References: <482849B0.6050103@nsoft.lt>
	<200805121801.35101.achill@matrix.gatewaynet.com>
	<20080.1210604951@sss.pgh.pa.us>
	<200805130956.51872.achill@matrix.gatewaynet.com>

Achilleas Mantzios <achill@matrix.gatewaynet.com> writes:
> So it seems that the arbitary assumption of (1 month=30 days, and 1 day = 24 hours) has already been made in the extract function.

Right, as I said:

>> You can derive a number if you're willing to make arbitrary assumptions
>> about the relationships of the different units (as indeed extract(epoch)
>> does),

The point is that we don't want to propagate that bogus assumption
further than we have to.  EXTRACT() already implies loss of information,
so it's reasonable for it to deliver a simplified view of reality, but
it doesn't follow that division should.

			regards, tom lane



view thread (11+ messages)

Message-ID: <24656.1210688127@sss.pgh.pa.us>
Permalink:  ../24656.1210688127@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24656.1210688127@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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, achill@matrix.gatewaynet.com, julius@nsoft.lt
  Subject: Re: how to get a number of seconds in some interval ?
  In-Reply-To: <24656.1210688127@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