Ricardo Kustner wrote:

to quote from the source "Postgresql is a hell when is comes to blobs"

however, I want to test if it's possible to use postgresql 8.0 and storing
the blobs in the database.

I tried to following:
unpack mmbase.jar
edit org/mmbase/storage/implementation/database/resources/postgresql.xml
and:
        - remove <option name="database-stores-binary-as-file" />
        - add <option name="database-supports-blob" />
        - add <type-mapping name="BYTE" min-size="1" max-size="16777216"
type="BYTEA" />
repack mmbase.jar with the new xml and replace it in WEB-INF/lib/

Sounds ok

When I upload a picture through my_editors, it shows a thumbnail on the
overview page, but when I click on it, to view the original size, I get a
broken image.
sometimes even the thumbs are broken after a while.

Thumbs smaller then 100K are kept in memory for a while. see caches.xml.

my first question is, has anybody tried to use postgresql8.0 with blobs in
the database?
it's kinda weird that it does work half of the time, instead of not at
all...

I have only experience with 7.x. but bytea was working in that release. It was also very time and memory consuming. Hope they solved that in 8

there's one interesting I noticed: since the content of the blob is logged
in the debugging log, sometimes I see "escaped" binary data
(\377\330\377\341\027IExif\000\000II*\000...)  but other times it shows it
unescaped / unprintable (you know, the ones that make your terminal go
crazy)

Have you only tried it with debugging on? I did that once and killed all my image functionality. Going back to info log level solved that. Can't remember what the real problem was.

when I check the postgreql doc, it mentions something about having to
escape octects in your queries. Does the storage do any escaping when
doing binary inserts?
(http://www.postgresql.org/docs/8.0/interactive/datatype-binary.html)

I hope the driver is solving that when we are using a PreparedStatement. The 7.x driver did.

Nico
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to