Does MultiSite Login work with PostgreSQL?
stodge - May 22, 2009 - 15:42
| Project: | Multisite Login |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
Does multisite_login only work with MySQL? I tried it on a server using MySQL and it's giving numerous errors. Also, the README file says to share users tables across databases, which I believe is only supported in MySQL using a database prefix:
$db_prefix = array(
'default' => 'main',
'users' => 'db1.main',
'sessions' => 'db1.main',
'role' => 'db1.main',
'authmap' => 'db1.main',

#1
You would be the first PG tester. I'd be happy to work with you to tweak queries to get them functioning. I did a quick scan and here's the only ones that I can see that might be a problem (Though I've never actually used PG, so I wouldn't know for sure):
Not sure if this sub-select will cause problems:
db_query('DELETE FROM {multisite_login_sessions} WHERE sid NOT IN(SELECT sid FROM {sessions});');
I'm not sure why I have the backquotes in this one but that will break PG:
db_query('SELECT s.sid, s.uid, s.hostname, s.timestamp FROM `'. $other_db .'`.sessions s WHERE s.sid = "%s"', $sid)
This one might need to be written in long-form:
db_query('INSERT INTO {multisite_login_sessions} (sid) VALUES("%s")', $sid);
I don't think PG can do REPLACE. This one is in hook_enable:
db_query('REPLACE INTO {multisite_login} SET uid = %d, pass_hash = "%s"', $uid, $pass_hash);
If you can run those in isolation and see which ones work and which ones don't, then we can alter accordingly.
Regards to your "can PG do multisite" question I found this page here:
http://drupal.org/node/45332
http://drupal.org/node/290768
your Google skills are probably better than mine.
#2
Thanks. I'm not sure I'll have time to look at this. At the end of the day, we may use ldap authetication instead. I'll see what I can do.
Thanks
#3
I reworked the queries that I know for sure would not work. For the others I'll need someone to try it out who uses PG.