Data Types

From: David Olbersen <dave(at)slickness(dot)org>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Data Types
Date: 2001-02-16 18:45:36
Message-ID: Pine.LNX.4.31.0102161045140.12655-100000@bubbles.electricutopia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-02-16 19:22:49 Re: Data Types
Previous Message Roberto Mello 2001-02-16 18:31:25 PL/PgSQL FOR syntax