https://bugzilla.wikimedia.org/show_bug.cgi?id=42659

José Antonio <fal...@reisng.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fal...@reisng.eu

--- Comment #13 from José Antonio <fal...@reisng.eu> ---

Conclusion database can be created with the dumped sql stataments and using not
name or the generated name: smw_object_ids_smw_id_idx
Table in mediawiki database fails to be created because there is a name
collision in the sql statament: index name is the same that the name of the
table.

Admin functions for Semantic MediaWiki;Database installation and upgrade
Initialise or upgrade:
"Setting up standard database configuration for SMW ...
Selected storage engine is "SMWSQLStore" (or an extension thereof)
Checking table "smw_object_ids" ...
   Table not found, now creating...
   ... done"

However database is not created:

Table in mediawiki database fails to be created because there is a name
collision in the sql statament: 
Debug info{
tail /var/log/postgresql 
 GMT ERROR:  relation "smw_object_ids" already exists
 GMT STATEMENT:  CREATE /* SMWSQLHelpers::createIndex Omr */ INDEX

Looking at SMW SQL statements 
add the following variables to LocalSettings.php:

$wgDebugLogFile = "/path/to/log/file/debug.log";
$wgDebugDumpSql = true;
//
http://semantic-mediawiki.org/wiki/Semantic_MediaWiki_database_tables#Looking_at_SMW_SQL_statements
//

CREATE TABLE "smw_object_ids" (smw_id  SERIAL NOT NULL PRIMARY
KEY,smw_namespace  BIGINT NOT NULL,smw_title  TEXT NOT NULL,smw_iw  TEXT NOT
NULL,smw_subobject  TEXT NOT NULL,smw_sortkey  TEXT NOT NULL,smw_proptab
le_hash  BYTEA) 

CREATE /* SMWSQLHelpers::createIndex Omr */ INDEX "smw_object_ids" ON
"smw_object_ids" USING btree(smw_id)

This causes the name collision:  GMT ERROR:  relation "smw_object_ids" already
exists  and therefore  Database fails to be created.

http://www.postgresql.org/docs/9.1/static/sql-createindex.html

CREATE INDEX -- define a new index 

The name of the index to be created. No schema name can be included here; the
index is always created in the same schema as its parent table. If the name is
omitted, PostgreSQL chooses a suitable name based on the parent table's name
and the indexed column name(s).

Then 

 CREATE   INDEX "smw_object_ids" ON "smw_object_ids" USING btree(smw_id);

Causes postgres to name the index as: smw_object_ids_smw_id_idx
Pgadmin:
:-- Index: smw_object_ids_smw_id_idx

-- DROP INDEX smw_object_ids_smw_id_idx;

CREATE INDEX smw_object_ids_smw_id_idx
  ON smw_object_ids
  USING btree
  (smw_id );

Conclusion database can be created with the dumped sql stataments and using not
name or the generated name: smw_object_ids_smw_id_idx

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to