If you try to use shoutbox with Postgres (at least version 8.3), shouts are not created (you get a listing of n/a) when you create them, and trying to "list all shouts" gives you an error of:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: null value in column "hostname" violates not-null constraint in /home/chris/vijay/includes/database.pgsql.inc on line 139.
    * user warning: query: INSERT INTO shoutbox (uid, nick, shout, url, moderate, created, changed, sid) VALUES (1, 'admin', 'I''m in charge here', 'www.chriscurvey.com', 0, 1234191751, 1234191751, '0e60b7b30e18414721c99e68c217712f') in /home/chris/vijay/sites/all/modules/shoutbox/shoutbox.module on line 27.

My solution to the problem was to make the "hostname" field nullable at line 666 in shoutbox.install. I guess another (maybe better) solution would be to add a default to that field.

Comments

disterics’s picture

Assigned: Unassigned » disterics

Will fix this in the next release.

alek123’s picture

I change shoutbox.module, line 666 to:

db_query("INSERT INTO {shoutbox} (uid, nick, shout, url, moderate, created, changed, hostname, sid) VALUES (%d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $user->uid, $form_state['values']['nick'], $form_state['values']['message'], $form_state['values']['url'], $moderate, $created, $created, ip_address(), session_id());

I save ip_address() in that field, while the next version is realesed.

Thanks!!!

Alek

disterics’s picture

Finally managed to install postgresql on my mac and reproduce the problem. Problem is, we no longer user the ip_address column but we were keeping it to help identify anonymous users from previous versions.
I will update the schema to exclude this column and delete it from old installs.

slinc’s picture

I'm getting:

user warning: Unknown column 'url' in 'field list' query: INSERT INTO shoutbox (uid, nick, shout, url, moderate, created, changed, sid) VALUES (1, 'admin', 'Test', '', 0, 1275674550, 1275674550, '46d038d21f20bb65692133dbbf7dbd8b') in /home2/.../sites/all/modules/shoutbox/shoutbox.module on line 666.

After seeing a listing of ": n/a".

This happened on mysql.

I would use the version 2.0, but there is now way I can put the input field below the shouts. Could anyone please give me advice on how to fix this problem, or do so with the 2.0 version?

Thanks!

vitalblue’s picture

Issue summary: View changes
Status: Active » Closed (outdated)