Moderating comments fails with PostgreSQL database and 4.6.x. The problem is similar as in this bug, except that it affects ALL users, not just non-admins.

When the moderate button is clicked, the following error appears:

warning: pg_query(): Query failed: ERROR:  invalid input syntax for integer: "" in /var/www/html/includes/database.pgsql.inc on line 45.
user error: 
query: UPDATE liitto_users… (I had to cut the rest of the query off to avoid drupal.org input data check failures, sorry.) in /var/www/html/includes/database.pgsql.inc on line 62.
warning: Cannot modify header information - headers already sent by (output started at /var/www/html/includes/common.inc:320) in /var/www/html/includes/bootstrap.inc on line 701.

Comments

grcm’s picture

I tried to file a decent bug report, but the watchdog didn't like me posting SQL.

I have the same problem with an update on the users table during moderation.

Drupal is trying to insert strings in to the sort, threshold and mode columns- these are actually smallints.

purluno’s picture

Version: 4.6.1 » 4.6.4
Component: postgresql database » user.module

I clicked 'moderate comments' and the error is caused.

warning: pg_query(): Query failed: ERROR:  invalid input syntax for integer: "" in .../drupal-4.6.4/includes/database.pgsql.inc on line 45.

user error: 
query: UPDATE users SET mode = '', sort = '', threshold = '', *data* = 'a:2:{s:5:"roles";a:1:{i:0;s:1:"2";}s:17:"comments_per_page";s:0:"";}',  changed = 1133973004 WHERE uid = 1 in .../drupal-4.6.4/includes/database.pgsql.inc on line 62.

warning: Cannot modify header information - headers already sent by (output started at /var/www/dev/drupal-4.6.4/includes/common.inc:384) in .../dev/drupal-4.6.4/includes/common.inc on line 192.

('*data*' => 'data')

I think the problem is from user.module, function user_save(...).

PostgreSQL doesn't allow assigning string to integer-type column. So it's needed to substitute '' to appropriate integer value.

magico’s picture

Status: Active » Closed (fixed)