SQL errors with PostGreSQL
Brad_Macpherson - August 21, 2007 - 15:42
| Project: | User Activity |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | sanduhrs |
| Status: | closed |
Description
Following errors after enabling module:
- warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "user_activity" does not exist in /opt/csw/apache2/share/htdocs/drupal-5.2/includes/database.pgsql.inc on line 125.
- user warning: query: SELECT COUNT(uid) AS count FROM user_activity WHERE uid=1 in /opt/csw/apache2/share/htdocs/drupal-5.2/includes/database.pgsql.inc on line 144.
- warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "user_activity" does not exist in /opt/csw/apache2/share/htdocs/drupal-5.2/includes/database.pgsql.inc on line 125.
- user warning: query: INSERT INTO user_activity (uid, pis, logins, since) VALUES (1, 1, 1, 1187702674) in /opt/csw/apache2/share/htdocs/drupal-5.2/includes/database.pgsql.inc on line 144.
Patch is attached that creates this table in PostGreSQL:
--- user_activity/user_activity.install Tue Aug 21 15:00:53 2007
+++ user_activity.original/user_activity.install Mon Jul 16 14:54:40 2007
@@ -15,13 +15,6 @@
);
break;
case 'pgsql':
- db_query("CREATE TABLE user_activity (
- uid int_unsigned NOT NULL PRIMARY KEY,
- pis integer NOT NULL,
- logins integer NOT NULL,
- since integer NOT NULL
- );"
- );
break;
}
}
@@ -31,4 +24,4 @@
*/
function user_activity_uninstall() {
db_query('DROP TABLE {user_activity}');
-}
+}| Attachment | Size |
|---|---|
| user_activity_pgsql.patch.txt | 622 bytes |

#1
Actually, that patch won't work - try this one:
diff -nur user_activity.original/user_activity.install user_activity/user_activity.install--- user_activity.original/user_activity.install Mon Jul 16 14:54:40 2007
+++ user_activity/user_activity.install Tue Aug 21 15:00:53 2007
@@ -15,6 +15,13 @@
);
break;
case 'pgsql':
+ db_query("CREATE TABLE user_activity (
+ uid int_unsigned NOT NULL PRIMARY KEY,
+ pis integer NOT NULL,
+ logins integer NOT NULL,
+ since integer NOT NULL
+ );"
+ );
break;
}
}
#2
That patch didn't apply either.
Applied it manually, as it is not very complex.
Commited to CVS.
Thanks.
#3