Re: How to store fixed size images?

Поиск
Список
Период
Сортировка
От sunpeng
Тема Re: How to store fixed size images?
Дата
Msg-id CAOYKhLo0+eeakp37g7mjjokN3qXo0jB9QLTVKcQFh+CLqVKv_Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to store fixed size images?  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
Thank you, Jeff!
peng


On Wed, Jun 18, 2014 at 12:15 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
On Mon, Jun 16, 2014 at 6:10 PM, sunpeng <bluevaley@gmail.com> wrote:
> We have many small size(most fixed size) images, how to store them? There
> are two options:
> 1. Store images in folders, managed by os file system, only store path in
> postgresql
> 2. Store image as bytea in postgresql
> How do you usually store images?

I use method 1, because the library/modules I made use of only
implemented that method.  I'd prefer to use method 2, but not enough
to write the code for doing it when there was existing code.  The
problem with 1 is now you have two streams of data to back up, and the
data itself is no longer transactional with its metadata.  A potential
problem with 2 is that it will run into problems if any of the data is
more than a small fraction of RAM.  So the images must be "always
small".  If they are just "usually small", that isn't good enough.
Another problem with bytea is the encoding issues.  Good up-to-date
drivers will handle that for you (mostly) transparently, but there are
lots of drivers that are not good, or not up-to-date.

Cheers,

Jeff

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

Предыдущее
От: Edson Richter
Дата:
Сообщение: Re : Global value/global variable?
Следующее
От: Rémi Cura
Дата:
Сообщение: python modul pre-import to avoid importing each time