Hi there, the forwarding works, it just doesn't get logged so Forward Tracking always reports "No one has used Forward yet." and my logs are getting filled up with SQL errors due to the lack of tables to query. I love this module, but it would be even better if I could see if it actually was working on my site.
pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: there is no unique constraint matching given keys for referenced table "node" in /var/www/<redacted>/includes/database.pgsql.inc on line 125.
query: CREATE TABLE forward_log ( nid integer references node (nid) NOT NULL, type text NOT NULL, timestamp integer NOT NULL ) in /var/www/<redacted>/includes/database.pgsql.inc on line 144.
pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: syntax error at or near "KEY" at character 269 in /var/www/<redacted>/includes/database.pgsql.inc on line 125.
query: CREATE TABLE forward_statistics ( nid integer NOT NULL, last_forward_timestamp integer NOT NULL default '0', forward_count integer NOT NULL default '0', clickthrough_count integer NOT NULL default '0', PRIMARY KEY (nid) KEY (last_forward_timestamp) ) in /var/www/<redacted>/includes/database.pgsql.inc on line 144.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | forward_install_psql_tables_197162.patch | 832 bytes | suzanne.aldrich |
Comments
Comment #1
seanrGot any advice on how to fix it? I've never used pgsql (all of my sites are mysql), so me trying to write pgsql queries is a bit of a crapshoot. ;-)
Comment #2
suzanne.aldrich commentedWith the kind help of kryptt on irc, we figured out how the postgresql tables should be created: http://drupalbin.com/278
When creating the forward_log table,
nid integer references node (nid) NOT NULLshould benid integer NOT NULL.When creating the forward_install table, you don't need this:
KEY (last_forward_timestamp).Attached is a patch for your review. My tests indicated that my db now contains both tables, and they are recording forwards and clickthroughs. (The queries for the block and views are throwing errors, which I shall have to open in another issue. I have a lot of problems with views and pgsql queries. Argh.)
Comment #3
seanrFixed in CVS; will appear in the next release this afternoon. Thank you very much for helping to track this down. If you do get anywhere with views, please let me know, though realize that may be an issue with views and not forward. Either way, post it here and then we'll switch it to views if necessary.
BTW, just out of curiosity, why do people use pgsql? Seems to me that mysql is much more widely supported; is there something that pgsql does that makes it better for certain applications? Thanks.
Comment #4
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.