RE: Re: Storing images in PG?

Поиск
Список
Период
Сортировка
От Andrew SNow
Тема RE: Re: Storing images in PG?
Дата
Msg-id 000801c1263a$14cb9710$fa01b5ca@avon
обсуждение исходный текст
Ответ на Re: Re: Storing images in PG?  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-general
> > Correct me if I'm wrong, but the only thing "lztext" can't store is
> > NULLs, which could escaped somehow with other (rare) characters.
> > Still overhead, but you shouldn't be storing large pieces of binary
> > data this way, I think.
>
>  Here is not a problem with storing binary data to some
> datetype (like bytea), but problem is with other parts of PG.
> For example libpq
> functions read queries as string, other thing is query
> parsing where is needful set correct chars (like quote), etc.
>  IMHO if you want to work with queries with no problems and limits is

Right, and I'm saying you can save that space by simply escaping all
your characters in the normal way, e.g. SELECT '\377'  is the ASCII
character 0xFF.  This would work for all characters except NULL, which
you could represent by \377\377  (and you could represent a real \377 by
\377\376 or something).  Then the space wastage would be minimal
compared to using base 64.

I wrote a perl module which wraps around Pg, in which you can use
parameters in queries, and it automatically escapes extended ascii
characters as per above, however I have never tried storing binary data
using the whole 0x01 -> 0xFF range as I just described, but I think it
would work.


- Andrew


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

Предыдущее
От: "Eric Ridge"
Дата:
Сообщение: RE: Re: Re: Storing images in PG?
Следующее
От: "Ben-Nes Michael"
Дата:
Сообщение: Roll Back dont roll back counters