This is a small patch for Image Attach to get image_attach_update_2() working with Postgres. I've only tested it against the 5.x-1.1 release, but it looks like it should work with the current release, too.

Comments

drewish’s picture

wouldn't the pgsql query work with mysql as well?

drewish’s picture

do you think http://drupal.org/node/156752 is a duplicate of this?

drewish’s picture

Title: Postgres support » image_attach_update_2() is incompatible with Postgres
Status: Needs review » Fixed

no, after testing it i found that, at least with mysql 5.1 the pgsql query doesn't work.

thanks for submitting this. i've committed to to HEAD and DRUPAL-5.

HorsePunchKid’s picture

It may be a duplicate; I can't be sure. The error I got explicitly stated that it was not acceptable to have {image_attach} appear twice, once in the FROM and once in the USING. But it's possible that the only difference between this and the other issue is improved error reporting in the more recent version of Postgres that I'm running.

I'm pretty sure the Postgres-flavored query will work with MySQL, too, but I like MySQL's explicit join; I think it makes it clearer what the query is deleting. So it seemed best to leave it untouched. Also, I don't have an easy way to test it on MySQL. :)

I'll try to get upgraded to the latest version of the module soon and make sure everything is still working properly.

Anonymous’s picture

Status: Fixed » Closed (fixed)