Help - Search - Members - Calendar
Full Version: PostgreSQL problems with Plugindata
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
hdstich
hi all,

i installed the EntryReadCounter plugin (MT Support Forum) and changed the scripts to work with my PostgreSQL backend database and thereby i found a problem in the Plugindata.pm module of my Movable Type installation V2.6.4. in the Plugindata.pm module the Perl Storable module is used to serialize the Perl objects which shall be stored in the backend database into strings. now this strings may contain null bytes, which lead to problems inserting it into the PostgreSQL table 'mt_plugindata'. the INSERT operation fails because a null byte means end of query to the PostgreSQL db. escaping all null bytes in the serialzed string AND changing the data type of the 'mt_plugindata' field 'data' from 'text' to 'bytea' should solve the problem.

/hd

Photolog: http://DigitalFotoKunst.de/
hdstich
hi all,

i solved the problem using the MIME::Base64 module.

i'm encoding the data after it is serialized and before it is stored in the PostgreSQL database and i decode it after it is fetched from the database and before it is deserialized.

i also changed the type of the 'data' field in the mt_plugindata table from 'text' to 'bytea'.

/hd
fooljay
I can verify this as I have been inundated with bug reports for MT-Blacklist from people using PostgresDB.

The error string is always something like
CODE
ERROR: parser:
unterminated quoted string at or near "'1234Ã" at character 136

Since I cannot (nor want to) ask thousands of people to hack their MT installation, I am offering an alternate method of persistent data storage using YAML but it is unfortunately much slower than the PluginData method...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.