I just installed the Advertisement module and got the following error on Drupal 5.1 + PostgreSQL 8.2 - is it because pgsql is not supported?
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "(" LINE 2: aid INT(10) UNSIGNED NOT NULL UNIQUE DEFAULT '0', ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ads ( aid INT(10) UNSIGNED NOT NULL UNIQUE DEFAULT '0', uid INT(10) UNSIGNED NOT NULL DEFAULT '0', gid INT(10) UNSIGNED NOT NULL DEFAULT '0', adstatus VARCHAR(255) NOT NULL DEFAULT '', adtype VARCHAR(255) NOT NULL DEFAULT '', redirect VARCHAR(255) NOT NULL DEFAULT '', autoactivate INT UNSIGNED NOT NULL DEFAULT '0', autoactivated INT UNSIGNED NOT NULL DEFAULT '0', autoexpire INT UNSIGNED NOT NULL DEFAULT '0', autoexpired INT UNSIGNED NOT NULL DEFAULT '0', activated INT UNSIGNED NOT NULL DEFAULT '0', maxviews INT UNSIGNED NOT NULL DEFAULT '0', maxclicks INT UNSIGNED NOT NULL DEFAULT '0', expired INT UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (aid), KEY (uid), KEY (gid), KEY (autoactivate), KEY (autoexpire)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "UNSIGNED" LINE 2: gid INT UNSIGNED NOT NULL AUTO_INCREMENT, ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ad_groups ( gid INT UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', PRIMARY KEY (gid), UNIQUE KEY (name)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "ad_groups" does not exist in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: INSERT INTO ad_groups (gid,name, description) VALUES(1, 'default', 'All new advertisements will be added to this default group until you create your own custom advertisement groups.') in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "(" LINE 2: oid INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ad_owners ( oid INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, aid INT(10) UNSIGNED NOT NULL DEFAULT '0', uid INT(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (oid), KEY (aid), KEY (uid)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "(" LINE 2: oid INT(11) UNSIGNED NOT NULL DEFAULT '0', ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ad_permissions ( oid INT(11) UNSIGNED NOT NULL DEFAULT '0', permissions LONGTEXT NULL DEFAULT '', PRIMARY KEY (oid)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "UNSIGNED" LINE 2: sid INT UNSIGNED NOT NULL AUTO_INCREMENT, ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ad_statistics ( sid INT UNSIGNED NOT NULL AUTO_INCREMENT, aid INT UNSIGNED NOT NULL DEFAULT '0', date INT(10) UNSIGNED NOT NULL DEFAULT '0', action VARCHAR(255) NOT NULL DEFAULT '', hostid VARCHAR(32) NULL DEFAULT '', count INT(11) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (sid), KEY (aid), KEY (date), KEY (action), KEY (hostid)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "UNSIGNED" LINE 2: cid INT UNSIGNED NOT NULL AUTO_INCREMENT, ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ad_clicks ( cid INT UNSIGNED NOT NULL AUTO_INCREMENT, aid INT UNSIGNED NOT NULL DEFAULT '0', uid int(10) UNSIGNED NOT NULL DEFAULT '0', hostname varchar(128) NOT NULL DEFAULT '', hostid varchar(32) NOT NULL DEFAULT '', url varchar(255) DEFAULT '', timestamp INT(11) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (cid), KEY (aid), KEY (hostname), KEY (hostid), KEY (url)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "UNSIGNED" LINE 2: uid INT UNSIGNED NOT NULL DEFAULT '0', ^ in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE ad_hosts ( uid INT UNSIGNED NOT NULL DEFAULT '0', hostid varchar(32) DEFAULT '', description TEXT NOT NULL DEFAULT '', PRIMARY KEY (uid), KEY (hostid)) in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "ad_groups" does not exist in /usr/local/www/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT gid, name FROM ad_groups in /usr/local/www/drupal5/includes/database.pgsql.inc on line 144.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | postgres_3.patch | 11.44 KB | jeremy |
Comments
Comment #1
jeremy commentedSorry, postgresql support is totally untested. I suspect you will need to cleanup the ad.install file (and other .install files) for this to work. Patches are welcome, this is not something I will be working on myself.
Comment #2
jeremy commentedEvan Leybourn emailed me a patch that should get the module working with Postgres. It's against an older version of the module so doesn't apply perfectly, but it's enough to know what needs to be done. I'll probably manually merge this myself at some point soon. Or, anyone wanting to update the patch to both the 4.7.x and 5.x development trees would be appreciated.
Comment #3
jeremy commentedPatch manually merged into the 4.7.x and 5.x development trees. The development version of the ad module should now work with PostgreSQL.
Comment #4
(not verified) commented