PostgreSQL, LIMIT, and DELETE
AlexisWilke - July 5, 2009 - 20:57
| Project: | Boost |
| Version: | 6.x-1.x-dev |
| Component: | Installation |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | postgres |
Description
You just cannot use LIMIT with a DELETE statement under PostgreSQL. This may be a limit, and certainly a nice optimization (since once the variable is deleted, you don't have to continue searching... although if the name column is marked as unique, the optimization is already built in any good SQL handler.)
Anyway, please, remove the LIMIT 1 from your install script:
<?php
/**
* Update 6102 - Delete old boost permissions variable.
*/
function boost_update_6102() {
// del variable
return update_sql("DELETE FROM {variable} WHERE name = 'boost_permissions'");
}
?>Another way to delete a variable is to use the variable_del() function. Although that one would not return an error list the update_sql() function can.
Thank you.
Alexis Wilke

#1
Going to use http://api.drupal.org/api/function/comment_update_6002/6 for some inspiration. Thanks for pointing me in the right direction with variable_del().
#2
If you could test this, that would be great!
#3
Hi mikey,
Looks good! 8-)
Thank you.
Alexis
#4
committed
#5
Automatically closed -- issue fixed for 2 weeks with no activity.