Search Postgresql Archives

Re: what is the best way of storing text+image documents in postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/08/2011 06:13 PM, Arash pajoohande wrote:

1. save .doc documents in bytea columns. and show them with a word
reader in web page (disadvantage: it needs a proper .doc reader
installed on user computer)

1a: Convert the .doc files to a standard format like PDF that most browsers can display. That's what I'd do.

2. convert document to html format and store html code as string
(disadvantage: images will remain in file system)

You could always store images as 'bytea' fields on a subtable.

CREATE TABLE doc (
  id serial primary key,
  doc_html text,
  ...
);

CREATE TABLE doc_images (
  id serial primary key,
  doc_id integer references doc(id),
  image_data bytea not null
);

There are advantages and disadvantages to storing files in the database vs in the file system. It's been discussed to death recently, so see the mailing list archives.

--
Craig Ringer

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux