Hi all,

I've adapted SMW_SQLStore2 to make it work with PostgreSQL 8.3 backend - the 
database setup/initialization for SMW now runs through without problems. 
Indexes/keys are created/modified as expected; however, I just tested the case 
where a new installation has to be performed. So please consider this as 
experimental "works for me" code.

There are the following differences/problems in my installation compared with 
the original MySQL-Only setup:

1) DROP TABLE IF EXISTS  has been replaced by DROP TABLE, this means that 
removing everything will presumably fail in some cases
2) the data types are somewhat different, I don't know if my choices make sense 
with all respects (e.g. substituting "bytea" for MEDIUMBLOB)
3) reordering fields cannot be done easily in PostgreSQL - additional fields 
are always appended to the end. If somebody really cares about this, the 
workaround usually is:

 a) do two separate dumps for schema and data; the data dump should be a "full 
inserts" dump for data [including column names] 
 b) modify the schema dump accordingly, changing field order as desired
 c) restore the new schema 
 d) restore the data with triggers disabled

4) For creating/modifying the schema and indexes I used the postgresql 
dictionary (as opposed to the ANSI dictionary that would be a better choice for 
portability). I had to to this becaulse INDEXes do not exist in standard ANSI 
SQL (for good reason; normally indexes are just an internal optimization of the 
database done when the application relies on keys, but it seems that most MySQL 
users don't even know what a key is ;) ). Consequently my procedure is 
dependent on PostgreSQL version 8.3 and certainly needs adaptation for releases 
before 8.3 and perhaps even for future releases. Maybe that 8.1 and 8.2 work, 
but this requires further testing.

5) For security reasons, my setup uses a separate SCHEMA for the mediawiki/SMW 
within the general database (as opposed to using the default "public" schema), 
but this does not seem to make any problems. To make that work, I use a login 
name that corresponds to the schema name and have set the search path within 
postgresql.conf accordingly.

Please find enclosed the diffs against version 1.4.1.

Regards
--Marcel

Attachment: SMW_SQLStore2.php.diff
Description: Binary data

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to