quotes.install does not correctly setup a PostgreSQL-Database. For column 'nid' in table 'quotes_blocks' type INTEGER is used and later a Sequence is created. However, the correct behaviour to have postgre use a Sequence on the column is to use the type 'serial".
The Attached Diff will change this behaviour.

Comments

fantux’s picture

StatusFileSize
new2.13 KB

I'm sorry, the previous diff was incorrect. It fixed only one of the problems present.
This one should be correct. I also removed the drop-statement dor the sequence in quotes_uninstall. The sequence is now created implicitly and postgre takes care of removing it when the table os dropped.

fantux’s picture

StatusFileSize
new1.64 KB

I'm sorry, the previous diff was incorrect. It fixed only one of the problems present.
This one should be correct. I also removed the drop-statement dor the sequence in quotes_uninstall. The sequence is now created implicitly and postgre takes care of removing it when the table os dropped.

fantux’s picture

StatusFileSize
new1.64 KB

I'm sorry, the previous diff was incorrect. It fixed only one of the problems present.
This one should be correct. I also removed the drop-statement dor the sequence in quotes_uninstall. The sequence is now created implicitly and postgre takes care of removing it when the table os dropped.

nancydru’s picture

Status: Active » Needs review

Updating status to show patch available.
@fantux: This is not a patch format that is typically used. Please use "diff -u -p".

See also: http://drupal.org/node/155886

nancydru’s picture

Does this look right?

function quotes_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query('CREATE TABLE {quotes} (
          nid INTEGER NOT NULL,
          vid INTEGER NOT NULL PRIMARY KEY,
          author VARCHAR(255) NOT NULL,
          citation VARCHAR(255),
          promote INTEGER NOT NULL
        ) /*!40100 DEFAULT CHARACTER SET utf8 */');
      db_query('CREATE INDEX {quotes}_nid ON {quotes} (nid)');
      db_query('CREATE INDEX {quotes}_promote ON {quotes} (promote)');

      db_query('CREATE TABLE {quotes_blocks} (
          bid INTEGER NOT NULL PRIMARY KEY,
          name VARCHAR(255) NOT NULL UNIQUE,
          block_type INTEGER NOT NULL,
          nid_filter TEXT NOT NULL,
          rid_filter TEXT NOT NULL,
          uid_filter TEXT NOT NULL,
          tid_filter TEXT NOT NULL,
          cron_interval INTEGER NOT NULL,
          cron_step INTEGER NOT NULL,
          cron_last INTEGER NOT NULL,
          vid INTEGER NOT NULL
        ) /*!40100 DEFAULT CHARACTER SET utf8 */');
      break;
    case 'pgsql':
      db_query('CREATE TABLE {quotes} (
          nid INTEGER NOT NULL,
          vid INTEGER NOT NULL PRIMARY KEY,
          author VARCHAR(255) NOT NULL,
          citation VARCHAR(255),
          promote INTEGER NOT NULL
        ) /*!40100 DEFAULT CHARACTER SET utf8 */');
      db_query('CREATE INDEX {quotes}_nid ON {quotes} (nid)');
      db_query('CREATE INDEX {quotes}_promote ON {quotes} (promote)');
      db_query('CREATE TABLE {quotes_blocks} (
          bid INTEGER NOT NULL PRIMARY KEY,
          name VARCHAR(255) NOT NULL UNIQUE,
          block_type INTEGER NOT NULL,
          nid_filter TEXT NOT NULL,
          rid_filter TEXT NOT NULL,
          uid_filter TEXT NOT NULL,
          tid_filter TEXT NOT NULL,
          cron_interval INTEGER NOT NULL,
          cron_step INTEGER NOT NULL,
          cron_last INTEGER NOT NULL,
          vid INTEGER NOT NULL
        ) /*!40100 DEFAULT CHARACTER SET utf8 */');
  }
}
nancydru’s picture

Assigned: Unassigned » nancydru
Status: Needs review » Fixed

Fix committed.

nancydru’s picture

Status: Fixed » Closed (fixed)