designing tables for blobs - what are the guidelines?

From: Cath Lawrence <Cath(dot)Lawrence(at)anu(dot)edu(dot)au>
To: pgsql-novice(at)postgresql(dot)org
Subject: designing tables for blobs - what are the guidelines?
Date: 2003-07-30 06:01:40
Message-ID: 4998ABA7-C253-11D7-B59E-00039390F614@anu.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi there,

I've been reading documentation and manuals and things and haven't been
able to find a discussion of this in a clear manner. (If anyone can
point me to a reference I've missed I'd be grateful.)

Here are some questions I have:
Can I put an arbitrary binary file in a bytea field?
And should I?
Is this the best way to store arbitrary binaries?

My motivating example: I have a largish table, with potentially tens of
thousands of rows. Each one has some simple numeric or text data, and
an OPTIONAL associated binary archive (.tar.gz) containing truly
arbitrary types of files. Sometimes a set of images in one format,
sometimes a single image in another format, sometimes a proprietary
file produced by certain lab equipment - and who knows where it might
go.

So I thought maybe it would make retrievals slow if I packed the
binaries in there. Or is that only if I'm lazy and "select * from
table"? Perhaps I should make a special archive table and refer to it
by some key. Say, id, [array of archive content file names], bytea for
the archive.

Is there a recommended way?
Is there something else I should try?

thanks for any feedback,
Cath
Cath Lawrence, Cath(dot)Lawrence(at)anu(dot)edu(dot)au
Senior Scientific Programmer, Centre for Bioinformation Science,
John Curtin School of Medical Research (room 4088)
Australian National University, Canberra ACT 0200
ph: (02) 61257959 mobile: 0421-902694 fax: (02) 61252595

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Cath Lawrence 2003-07-30 07:14:13 Re: designing tables - sidetrack into arrays
Previous Message Mendola Gaetano 2003-07-30 00:32:33 Re: help: now() + N is now failing!