Rewrite name unique check so it is cross-database compatible
neilnz - April 1, 2009 - 21:33
| Project: | Email Registration |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
Hi,
I wanted to use this module on Postgres, but your SQL query to fetch the next sequence number is MySQL-specific.
Patch attached for Postgres support.
Thanks
| Attachment | Size |
|---|---|
| email_registration.module.patch | 1.36 KB |

#1
I don't have a test bed for this, but here's a better status ;)
#2
This is not a real solution to the problem because it uses a switch. We should use standard sql.
As far as I can tell, this code is trying to find 1) if the name is unique, 2) if not, what is the highest "index" for the name. While it may be slightly slower, we should be able to do more of this in php and make it cross-database compatible.