Postgres support
aaron1234nz - October 14, 2008 - 09:07
| Project: | Image FUpload |
| Version: | 6.x-2.0-beta3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Thanks for writing this module. It's really sweet. I love it!!
Just a quick note on postgres support though. This module is nearly postgres compliant. The only thing holding it back is the LIMIT clauses in some of the SQL statements. Where its necessary to use query with a range, its better to use db_query_range.

#1
The problem is, I can't directly use db_query_range because it's important to use db_query of Drupal's API.
But where did you find some additonal LIMIT clauses in the code with two arguments? If I remember well, it's only allowed to use one argument with LIMIT to make it work with Postgre?
#2
Hi, yes your right about the single argument for LIMIT, I just checked the docs. The only offending query in this case is this one:
Line 101 of fupload_image module
// validate given session id
$result = db_query("SELECT * FROM {sessions} WHERE sid = '%s' AND hostname = '%s' LIMIT 0 , 1", $sid, ip_address());
#3
You changed the version, so this seems only to affect rc1. I thought that I had fixed in devel, right? If true, you could use this version instead, it's quite stable at the moment. But I will also fix the rc1 candidate next time, so the fixed version will be called rc2.
#4
I couldn't find any further "limit" statements which aren't compatible with PostGre.
#5
Fixed in 6.x-2.0-beta1.
#6
I've just installed beta3 and am adapting my code to work with it. Thanks for your efforts in working on this module!
One thing I noticed however is that there is a LIMIT clause on an UPDATE statement on 165 & 188 of fimage_upload.module. Postgres only supports LIMIT clauses on SELECT statements. I don't think that the LIMIT clauses are needed because fid is a primary key so there will only be one record to update anyway.
There are also a number of LIMIT clauses on update statements on in the image_fupload_image.module that are problematic (I have not looked at image_fupload_imagefield.module)
I've just removed the LIMIT clauses from each UPDATE statement and everything is running fine.
#7
OK, it should not be critical to remove these LIMIT statements, should be fixed in CVS Head now.
#8
Automatically closed -- issue fixed for two weeks with no activity.