Re: handle audiofiles in postgres

From: Christopher Browne <cbbrowne(at)ca(dot)afilias(dot)info>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: handle audiofiles in postgres
Date: 2009-09-03 15:53:06
Message-ID: 87ocpsf2jh.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

urs(dot)edisan(at)gmail(dot)com (edisan) writes:
> Can anyone used or tell me how to handle audio files in postgres
>
> Audio files may be in  wav / vox / dss format and each have average 30 min
> running time.

In principle, you could store these as "BLOB" data; I'd quite prefer
storing this as "bytea" data.

The TOAST capability
<http://www.postgresql.org/docs/8.4/interactive/storage-toast.html>
means that these "BLOBs" are actually stored in side tables, which
should be good for efficiency in that they won't make data tuples
enormous even though there's enormous data tied to them.

As a result, queries on metadata (e.g. - the other attributes of the
data) can be nicely efficient despite the bulky data.

It's not obvious, however, that storing the files in the database is
preferable to:

- Putting the files in a filesystem, perhaps with cryptic names
(hashes?)

- Storing the metadata about the files in the database, referencing the
files' names

If there's good reason to store the files in the DBMS, then do so; just
make sure there's good reason for it!
--
let name="cbbrowne" and tld="ca.afilias.info" in name ^ "@" ^ tld;;
Christopher Browne
"Bother," said Pooh, "Eeyore, ready two photon torpedoes and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Lange 2009-09-03 15:55:41 Problem with leaking connections
Previous Message Andy Colson 2009-09-03 15:48:08 Re: easy task: concurrent select-updates