On Tuesday 09 December 2008 18:57:15 Frank Bax wrote:
> ivan marchesini wrote:
> > Hi to all...
> > I need to create a db that contain link to some pdf files..
> > At the moment these are simple links (to the files that are stored into
> > the file system) storing paths into a column of a dbf table...
> > 
> > I need to manage this data considering that the db I'm going to create
> > will be moved in some months to another server... 
> > so I think that the link to the files positions into the file system
> > isn't a valid solution...
> > 
> > can you suggest me a better way to manage this pdf data?? 
> > Each pdf is quite small (<100k)
> > 
> > should I use BLOB?
> 
> 
> Leave the files on filesystem and code the highest level directory into 
> a function.

Absolutely not. You'll loose transactional safety the DB provides. That reason 
alone is good enough to justify storing the files in a BLOB (BYTEA in PG).

The length(BYTEA)-function in PG can be used to retrieve its length. It is 
IMMUTABLE and "constant time", which means you can apply a functional-index on 
it. That way you don't need to store the size of the file in a separate column.

-- 
Andreas Joseph Krogh <[EMAIL PROTECTED]>
Senior Software Developer / CEO
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Karenslyst Allé 11      | know how to do a thing and to watch         |
PO. Box 529 Skøyen      | somebody else doing it wrong, without       |
0214 Oslo               | comment.                                    |
NORWAY                  |                                             |
Tlf:    +47 24 15 38 90 |                                             |
Fax:    +47 24 15 38 91 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to