January 29, 2005
Movable Type + PostgreSQL
I've been searching for a reason Movable Type didn't seem to want to play nice with PostgreSQL. (I prefer PostgreSQL to MySQL for databases where things are going to be changing somewhat often. Some will argue PostgreSQL is a real database while MySQL is a flat file.) Found an entry that describes exactly what is happening.
Here's a breakdown of what was changed:
sub data {
my $data = shift;
# Convert the data to hexadecimal.
$data->column('data', unpack("H*", freeze(shift))) if @_;
# Try to get the data.
my $r;
eval { $r = thaw($data->column('data')); };
# Decode the hexadecimal if thaw failed.
$r = thaw(pack("H*", $data->column('data'))) if ($@);
$r;
}
Posted by josuah at January 29, 2005 9:19 PM UTC+00:00
Trackback Pings
TrackBack URL for this entry:
http://www.wesman.net/cgi-bin/mt/mt-tb.cgi/108
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)