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)
Comment | File | Size | Author |
---|---|---|---|
#1 | 296096-blogapi-update-5000.patch | 1.02 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedLooks 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...).
Comment #2
munkie CreditAttribution: munkie commentedIt'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.
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedIn 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.
Comment #4
drummCommitted to 5.x.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.