During Drupal update from 5.9 to 5.10 on Postrgres DB
pg_query error occurs:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "uid" does not exist in Z:\home\brandz\test\includes\database.pgsql.inc on line 125.
* user warning: query: update_sql CREATE INDEX blogapi_files_uid_idx ON blogapi_files (uid) in Z:\home\brandz\test\includes\database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "unsigned" LINE 2: author int unsigned NOT NULL, ^ in Z:\home\brandz\test\includes\database.pgsql.inc on line 125.
* user warning: query: update_sql CREATE TABLE privatemsg_block_user ( author int unsigned NOT NULL, recipient int unsigned NOT NULL, PRIMARY KEY (author, recipient) ) in Z:\home\brandz\test\includes\database.pgsql.inc on line 144.

The following queries were executed
blogapi module
Update #5000

* CREATE TABLE {blogapi_files} ( fid serial, filename varchar(255) NOT NULL default '', filepath varchar(255) NOT NULL default '', filesize int_unsigned NOT NULL default 0, PRIMARY KEY (fid) )
* Failed: CREATE INDEX {blogapi_files}_uid_idx ON {blogapi_files} (uid)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Version: 5.10 » 5.x-dev
Status: Active » Needs review
FileSize
1.02 KB

Looks like something got wrong, here :)

It seems like the upgrade path was not tested in PostgreSQL on 5.x. Here is a patch. 6.x is not affected (thanks to the Schema API...).

munkie’s picture

It's better use 'integer' type for pgsql then 'int_unsigned', because indexes won't work because of column types mismatch in different tables, i.e. uid in users and uid in blogapi_files, and this will slower the queries.

Damien Tournoud’s picture

In the D5 schema, there are some inconsistencies on that front (uid is an unsigned_int in some foreign key tables and an int in others). In D6, this has been standardised as an unsigned int.

In order to guarantee the upgrade path, we have to keep the unsigned_int here.

drumm’s picture

Status: Needs review » Fixed

Committed to 5.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.