warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "N" LINE 1: ...nid, f.fid FROM upload AS u INNER JOIN files AS f N u.fid = ... ^ in /var/www/sandbox/includes/database.pgsql.inc on line 139.
user warning: query: SELECT nid, f.fid FROM upload AS u INNER JOIN files AS f N u.fid = f.fid WHERE f.filepath = 'sites/default/files/var_images/Sahtu/59021/Autumn Leaves.jpg' LIMIT 1 in /var/www/sandbox/sites/all/modules/imagecache_actions/utility.inc on line 275.
warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "N" LINE 1: ...nid, f.fid FROM upload AS u INNER JOIN files AS f N u.fid = ... ^ in /var/www/sandbox/includes/database.pgsql.inc on line 139.
user warning: query: SELECT nid, f.fid FROM upload AS u INNER JOIN files AS f N u.fid = f.fid WHERE f.filepath = 'sites/default/files/var_images/Sahtu/59021/Creek.jpg' LIMIT 1 in /var/www/sandbox/sites/all/modules/imagecache_actions/utility.inc on line 275.

As a postgres only user I tend to find all of these issues, I believe I have seen this before, But I could be out to lunch, but the short JOIN syntax used here is invalid in postgres, you must use the full join syntax for postgres compat..

Comments

spydmobile’s picture

Ok, My bad, this is NOT a postgres compat issue it is a typo on line 275 of utility.inc, it says:

 $sql = "SELECT nid, f.fid FROM {upload} AS u INNER JOIN {files} AS f N u.fid = f.fid WHERE f.filepath = '%s' LIMIT 1";

but should be:

 $sql = "SELECT nid, f.fid FROM {upload} AS u INNER JOIN {files} AS f ON u.fid = f.fid WHERE f.filepath = '%s' LIMIT 1";

Making this change eliminated the error.....

spydmobile’s picture

Status: Active » Closed (duplicate)

Gee 2 blunders in a row. Sorry. setting as duplicate

dman’s picture

Yeah typo.
Thanks anyway!!