[Devel] SF.net SVN: openser: [2310]
trunk/db/schema/pr_xcap_xml.xml
Klaus Darilion
klaus.mailinglists at pernau.at
Wed May 30 13:28:29 CEST 2007
Henning Westerholt wrote:
> On Mittwoch, 30. Mai 2007, Henning Westerholt wrote:
>>> Thus, to have consistent DB schemes why not use BLOB in mysql and bytea
>>> in postgresql?
>> Fine for me. Does this works for xcap_xml too?
>
> I mean: is this ok for presentity if we change this type consistently (in
> xcap_xml and presentity) to binary?
It is fine if presence module use the same data type as the database for
a certain column.
For example: presentity.body: presence module sets this column to type
DB_BLOB. Thus, during conversion from the internal types to the SQL
string (all data exchange between openser postgres module and postgresql
database is done via strings) in pb_val2str, the DB_BLOB will be escaped
(PQescapebytea). Then, when retrieving data, this data MUST be unescaped
in pg_str2val. The conversion from SQL strings to openser databyse
types depends on the column type reported by the database.
SQL type "text" is reported from postgresql as a string type.
SQL type "text" is reported from mysql as a BLOB type.
Thus, when using text (which is in postgresql handled as string) there
is no unescaping when retrieving the data.
Thus, for most columns it doesn't matter if it is a string or a blob -
as long as openser uses the same column type internally.
Thus, setting the column type of xcap_xml.xcap to a BLOB/BYTEA works
only if the presence module also sets the column type of xcap_xml.xcap
to DB_BLOB when inserting or updating data. I think in 1.2 the xcap
table is never written inside openser - thus it would be fine changing
the type. But I do not know if trunk version has some more features to
also write to xcap table.
regards
klaus
PS: Please correct me if I'm wrong
More information about the Devel
mailing list