pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Olbersen <dave@slickness.org>
To: pgsql-sql@postgresql.org
Subject: Data Types
Date: Fri, 16 Feb 2001 10:45:36 -0800 (PST)
Message-ID: <Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net> (raw)

Hello.

I have a table in which I'm trying to store the length of a sound file. I
decided to use the TIME data type. Was this correct? One of the operations I
want to do is sum() all of my files lengths to get the total amount in terms of
time, of sound that I have.

I notice that sum() doesn't take a TIME argument, so I cast it to an interval
as such:
  SELECT SUM( length::interval ) FROM songs;

However this gives me output that I don't know how to read: '7 02:34:27'
Does that read as 7 Days, 2 Hours, 34 Minutes and 27 seconds?

TIA

-- Dave




view thread (2+ messages)  latest in thread

Message-ID: <Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net>
Permalink:  ../Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net/
Also on:    postgresql.org/message-id/Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net

 · 

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-sql@postgresql.org
  Cc: dave@slickness.org
  Subject: Re: Data Types
  In-Reply-To: <Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net>
  References: <Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net>

* 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