Attached is a patch to the inactive_user.install for the 4.7 version of inactive_user module. As many of the columns are boolean in nature, I have made use of the Postgres boolean column type where appropriate. I also added in some messages for success or failure of the table creation as per another module install file.

I have not actually tried using the module to see if queries work or fail just yet but this patch will at least get the table bootstrapped up.

Comments

Crell’s picture

I'm afraid I don't use or know from PostgreSQL either. I'm willing to commit a PostgreSQL patch, but not until someone who actually uses PostgreSQL has reviewed it and set it RTBC.

Any PostgreSQL users, your input here is appreciated. :-)

Crell’s picture

Category: bug » feature
Crell’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

Now that there is a Drupal 5 release, new features will only be accepted against 5.x.

HorsePunchKid’s picture

StatusFileSize
new11.32 KB

This patch should get it working in Postgres, though I have not managed to test it yet. It also includes a number of "I can't believe MySQL allows that!" fixes, for what it's worth. For example, && and != are not operators that you'll see work in any other dialect of SQL, as far as I'm aware.

Patch is against the latest official release.

Crell’s picture

Status: Needs review » Needs work

Thanks, HorsePunch. Can you split the patch into two, though? As I said, I don' know from Postgres so I don't want to commit a Postgres patch until someone who uses Postgres has reviewed it, but I'm certainly game for "proper SQL" cleanup. Thanks.

HorsePunchKid’s picture

Status: Needs work » Needs review
StatusFileSize
new866 bytes

Good suggestion, Crell. The only modification I made that was explicitly aimed at supporting Postgres was the addition of a case to inactive_user.install. For some reason—I'm assuming a local problem at this point—inactive_user_install() never gets called when I enable the module, with or without my patch. So all I can confirm is that if I copy the CREATE verbatim from the install function and run it in Postgres, the module works fine.

Any insight into the install behavior would be much appreciated; I haven't had this kind of problem with other modules before.

HorsePunchKid’s picture

StatusFileSize
new10.48 KB

And here is a patch with just the changes to inactive_user.module. The changes are straightforward, replacing unusual syntax like '&&' with 'AND'. I have tested it a bit, and it seems to work fine. You can test this patch independently of the above patch; since I suspect Postgres support will require it, I figured I'd keep it in this issue.

jaydub’s picture

StatusFileSize
new2.01 KB

HorsePunchKid's patch applied clean for me and everything looks good for PostgreSQL.

Actually with the exception of the '&&' most of the rest of the syntax _does_ work in
PostgreSQL although for the sake of portability the changes in the patch do make for
the most portable SQL possible here.

I've also attached my own roll of an inactive_user.install patch. This patch includes a few
comments for the functions and an inactive_user_uninstall() implementation.

deekayen’s picture

Status: Needs review » Fixed

the && and the install hook for postgres table were the only things really needed, but the other stuff was nice, too

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.