I stumbled across an error:


    * warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: character varying = integer LINE 1: UPDATE users SET timezone_id = 308 WHERE timezone = -14400 A... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. in /var/www/sites/project/includes/database.pgsql.inc on line 139.
    * user warning: query: UPDATE users SET timezone_id = 308 WHERE timezone = -14400 AND timezone_id = 0 in /var/www/sites/project/sites/all/modules/event/event.module on line 275.

Comments

killes@www.drop.org’s picture

does pgsql take exception on the negative value for the int?

killes@www.drop.org’s picture

Status: Active » Postponed (maintainer needs more info)
protools’s picture

Postgres 8.4

User-configurable time zones:
+ Enabled
When enabled, users can set their own time zone

and

* warning: pg_query() [function.pg-query]: Query failed: ERROR: value too long for type character varying(8) in D:\BitNami WAPPStack\apache2\htdocs\blogmybaby\includes\database.pgsql.inc on line 139.
* user warning: query: UPDATE users SET timezone = '322|14400', name = 'luk911', mail = 'luk911@mail.ru', status = '1', data = 'a:7:{s:17:"messaging_default";s:4:"mail";s:27:"notifications_send_interval";s:1:"0";s:18:"notifications_auto";i:0;s:14:"picture_delete";i:0;s:14:"picture_upload";s:0:"";s:7:"contact";i:0;s:13:"form_build_id";s:37:"form-21643c66a27321b15e39b51d90609bf0";}' WHERE uid = 1 in D:\BitNami WAPPStack\apache2\htdocs\blogmybaby\modules\user\user.module on line 247.

rbroberts’s picture

The issue is the timezone is declared as varchar(8) and the query is supplying an integer. There is no automatic type conversion, so the query should be

db_query('UPDATE {users} SET timezone_id = %d WHERE timezone = \'%d\' AND timezone_id = 0', timezone_id, $user->timezone);

Note the quotes around the timezone value.

rbroberts’s picture

I'm not sure if I should create a separate item against 5.x-2.x-dev, but the problem is present there, which is what my previous post was testing. I'm attaching a patch for 5.x-2.x-dev, but it may apply to 6.x also.

rbroberts’s picture

StatusFileSize
new1.52 KB

Here is a patch against 6.x

rbroberts’s picture

Status: Postponed (maintainer needs more info) » Needs review

Changing status to hopefully trigger some action.

moskito’s picture

I am also using Postgres 8.4 with D6 and patch in #6 worked perfectly.

moskito’s picture

Status: Needs review » Reviewed & tested by the community

Almost 5 weeks without bad reviews, I guess it can be set as reviewed.

japerry’s picture

Status: Reviewed & tested by the community » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.