Re: Can the PostgreSQL store the Multimedia files

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: Can the PostgreSQL store the Multimedia files
Дата
Msg-id 87psktknwb.fsf@wolfe.cbbrowne.com
обсуждение исходный текст
Список pgsql-general
In the last exciting episode, senyorita.abeer@gmail.com wrote:
> hallo, I am working with a group on a Gradute project and we use the
> PostgreSQL database for build an information system for a school.
> we have a small question:
> - Can the PostgreSQL store the Multimedia files ( Images ,video
> ,audio....)??and exactly how??
> - IF not , can we make some change in the source code to make this
> support for multimedia??
>
> pleaze I want the answer very fast

One common answer to this is to say...

"Filesystems are usually pretty good at storing files.  That's their
strength; use them for that.  And then store metadata about them in a
database to make them easy to search for; that's what you should use
PostgreSQL for..."

That's a pretty good answer.

Systems like Xerox's Documentum do stuff like that.  You throw
documents into a "queue" to be put into the document archive, where
one portion of the queue is in a database, and contains metadata, such
as title, file type, creation date, and such like; the file is dropped
into a directory for processing.

The file is then renamed, using some magical hashing scheme, and
pushed out to the "permanent" storage system, and the database has
that hash name stored as the location.

On the other hand, you might conceivably have real reason to want to
have the file storage operation be part of the database transaction,
so that success/failure are managed by the database.

In that case, you have two further choices:

1.  Store the file data in a bytea field, which can be of fairly
arbitrary size.  Pushing the data in and out of that field can
sometimes be irritating.  [Insert something about ASCII NULLs here...]

2.  Use the lo_ functions that can do Unix-like file operations on
"Oid" fields.  This is the BLOB functionality in PostgreSQL.  I'd
generally much rather use bytea, but that's me...

Note that if you need to do stuff like database replication on this,
bytea is probably the only thing that would be replicable...
--
"cbbrowne","@","gmail.com"
http://linuxdatabases.info/info/linuxdistributions.html
"Though the Chinese should adore APL, it's FORTRAN they put their
money on." -- Alan Perlis

В списке pgsql-general по дате отправления:

Предыдущее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: in Pl/PgSQL, do commit every 5000 records
Следующее
От: venu gopal
Дата:
Сообщение: hi problem with installing postgresql8.1