Last modified: 2009-02-10 17:27:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T16071, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14071 - Wrong table schema / invalid queries in PostgreSQL (smw)
Wrong table schema / invalid queries in PostgreSQL (smw)
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
PC Linux
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2008-05-10 17:23 UTC by Urpo Lankinen
Modified: 2009-02-10 17:27 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Urpo Lankinen 2008-05-10 17:23:35 UTC
Hello, I tested Semantic MediaWiki extension on PostgreSQL (both 1.1.1 and yesterday's svn version). Here's what went wrong.


I tried creating page Property:Population with content "[[has type::number]]". It apparently performed this query...

   INSERT INTO smw_specialprops (subject_id,subject_namespace,subject_title,property_id,value_string) VALUES ('556','102','Population','1','_num');

...and it got back this response:

   ERROR: column "subject_title" of relation "smw_specialprops" does not exist

...which appears to be true. Is the PostgreSQL schema in sync with the MySQL schema?

Viewing *any* Property namespace pages seems to not work. For Property:Population, it appears to perform this query:

   SELECT DISTINCT subject_id FROM smw_relations WHERE relation_title='Population' ORDER BY subject_title LIMIT 26;

PostgreSQL thinks this is bad form:

   ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list


Not sure how much these help, but since the SMW developers asked for comments on how SMW works on PostgreSQL, I thought I'd submit my findings. Basically, I can browse articles and see their infoboxes, but viewing and editing property pages doesn't work, making the extension pretty useless at the moment. But we live in hope!
Comment 1 Ulrich Meier 2008-05-19 15:37:36 UTC
Also the query for creating a temporary table does not work with postgres:

A database error has occurred Query: CREATE TEMPORARY TABLE prop1( title VARCHAR(255) binary NOT NULL PRIMARY KEY) TYPE=MEMORY
Comment 2 Markus Krötzsch 2008-06-08 16:40:44 UTC
Since we have a new (additional) schema for MySQL soon, it would be worth to work on proper PostgreSQL support for this. The current MySQL schema data is found in the functions setup() in the files SMW_SQLStore.php and SMW_SQLStore2.php (new), both in ./includes/storage. Help for setting up a PostgreSQL version of this is appreciated -- we will assist where we can (feel free to contact me via email on that).

What is the problem with the temporary table query? Does PostgreSQL not support those, or is the syntax not appropriate?
Comment 3 Urpo Lankinen 2008-06-12 13:25:52 UTC
I'm thinking wrong syntax. "TYPE=MEMORY" looks badly like a MySQLism; I'm not sure if (or how) PostgreSQL does in-memory temporary tables, but PostgreSQL doesn't like weird=implementationspecificparameters. =) Here's the documentation: http://www.postgresql.org/docs/8.3/static/sql-createtable.html
Comment 4 Siebrand Mazeland 2008-08-11 11:05:22 UTC
Re-assign to extension developer for triage/comments.
Comment 5 Markus Krötzsch 2009-02-10 17:27:59 UTC
Thanks to the recent contribution of Marcel Gsteiger, SMW 1.4.2 offers basic PostgreSQL support. The feature is not yet tested properly, and various concrete issues might come up after some more practical experience with the code. Yet, this bug can now be closed in its generality.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links