On Fri, Jan 23, 2004 at 02:58:02PM +0000, Tim Sweetman wrote:
Toby Corkindale wrote:
I've written a file-attachment patch for OpenGuides and CGI::Wiki, which
stores the files in BLOBs. I've written the relevant CGI::Wiki::Store::Pg
module for Postgresql, but I don't know so much about SQLite or MySQL.
Do they support BLOBs?
I believe their interfaces (and that of other DBs) are very similar:
they both can handle BLOBbish data. The only issue off the top of my
head is to use placeholders rather than quoted values, but you were
probably gonna do that anyway...
Hmm, sounds like a very different interface..
Currently i call a DBI/DBD::pg function to get a file descriptor, and then i
can read(), write() and seek() on it.
I used to use Oracle when writing telephony apps for a few years, and that was
my first experience of working with blobs. Sounds like i may have become
ingrained/infected with that oraclism then! I've always done PostgreSQL stuff
in the same way since then. (Been using PostgreSQL for a very long time, but
never used to use it with massive fields until v7 era, and it was hard to
persuade Vodafone etc to go with an opensource database in the late 90s)
So, people are saying it's fine to just create a ByteA or BLOB type and just
fill it with 20Mb of binary data. OK then, off to re-write the code :)
I can see some disadvantages, in that i can't seek to part-way thru the file
and re-write a few bytes, ie random access, but for file attachments in a
wiki, that's not going to happen anyway.
IIRC some databases don't like to sort, compare,
or get distinct blob
values. (You probably weren't gonna do that anyway).