On Fri, Jan 23, 2004 at 06:23:25AM -0800, Randal L. Schwartz wrote:
"Toby" == Toby Corkindale tjc@wintrmute.net writes:
Toby> I've written a file-attachment patch for OpenGuides and CGI::Wiki, which Toby> stores the files in BLOBs. I've written the relevant CGI::Wiki::Store::Pg Toby> module for Postgresql,
Why? Rows in Pg are unlimited length, and BLOBs are supported only to be "oracle-like". It's preferred that you simply store the data in the row.
DBD::Pg doesn't seem to prefer it after all: wiki.cgi: DBD::Pg::db do failed: ERROR: parser: unterminated quoted string at or near "'BZh91AY&SY!!!z" at character 97
Note that this is with auto-quoting/escaping enabled, btw.
I tried using the quote method like so: $data = $dbh->quote($buffer, DBD::Pg::PG_BYTEA): and that went into a seemingly-infinite (or at least very long) loop, and dunking warnings about invalid characters into my webserver logs.
D'oh.
Looks like I'm going back to using the BLOBs method, which worked fine!
tjc.