OG Subgroups does not seem to install properly with Postgres as the database on the back end.
After installation it throws the following errors:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "og_ancestry" already exists in C:\cvs\realcme\drupaltest\node_development_instance3\includes\database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE og_ancestry ( gid int NOT NULL, parent int NOT NULL, PRIMARY KEY (gid, parent)); in C:\cvs\realcme\drupaltest\node_development_instance3\includes\database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "og_subgroups" does not exist in C:\cvs\realcme\drupaltest\node_development_instance3\includes\database.pgsql.inc on line 125.
* user warning: query: CREATE INDEX og_subgroups_gid_idx ON og_subgroups (gid); in C:\cvs\realcme\drupaltest\node_development_instance3\includes\database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "og_subgroups" does not exist in C:\cvs\realcme\drupaltest\node_development_instance3\includes\database.pgsql.inc on line 125.
* user warning: query: CREATE INDEX og_subgroups_parent_idx ON og_subgroups (parent); in C:\cvs\realcme\drupaltest\node_development_instance3\includes\database.pgsql.inc on line 144.
The following code is in og_subgroups.install:
function og_subgroups_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {og_subgroups} (
gid int(11) NOT NULL,
parent int(11) NOT NULL,
PRIMARY KEY (gid, parent)
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {og_ancestry} (
gid int NOT NULL,
parent int NOT NULL,
PRIMARY KEY (gid, parent));");
db_query("CREATE INDEX {og_subgroups}_gid_idx ON {og_subgroups} (gid);");
db_query("CREATE INDEX {og_subgroups}_parent_idx ON {og_subgroups} (parent);");
break;
}
}
For Postgres, is there a reason that table og_ancestry is being created rather than table og_subgroups? (With OG 5.x-7.3 og_ancestry already exists and it creates a conflict.) Also, are the two indexes {og_subgroups}_gid_idx and {og_subgroups}_parent_idx needed since gid and parent are already designated as primary keys?
Thanks
Comments
Comment #1
ezra-g commentedThanks for this report!
The postgres part of the install file needs some revision.
Comment #2
ezra-g commentedComment #3
ezra-g commentedComment #4
Peter.Farrow commentedThis code seems to work with similar changes made to function og_subgroups_update_1()
Comment #5
amitaibuThanks, i'll have time to fix it in a few days. (unless ezra you wanna do it, looks like changing
og_ancestrywithog_subgroupsComment #6
amitaibuI had a look, this issue is *already solved* in the 5.x4-.x version.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.