Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.Hostmaster module doesn't fully support Postgresql:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "hosting_client_user" does not exist in /var/www/html/includes/database.pgsql.inc on line 139.
* user warning: ERROR: relation "hosting_client_user" does not exist query: SELECT client, contact_type FROM hosting_client_user WHERE user=1 in /var/www/html/profiles/hostmaster/modules/hosting/client/hosting_client.access.inc on line 228.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "hosting_client_user" does not exist in /var/www/html/includes/database.pgsql.inc on line 139.
* user warning: ERROR: relation "hosting_client_user" does not exist query: SELECT client, contact_type FROM hosting_client_user WHERE user=1 in /var/www/html/profiles/hostmaster/modules/hosting/client/hosting_client.access.inc on line 228.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "hosting_client_user" does not exist in /var/www/html/includes/database.pgsql.inc on line 139.
* user warning: ERROR: relation "hosting_client_user" does not exist query: SELECT client, contact_type FROM hosting_client_user WHERE user=1 in /var/www/html/profiles/hostmaster/modules/hosting/client/hosting_client.access.inc on line 228.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | hosting-postgres.patch | 13.06 KB | mradcliffe |
| #10 | hosting-postgres.patch | 13.06 KB | mradcliffe |
| #6 | hosting-postgres.patch | 12.66 KB | mradcliffe |











Comments
Comment #1
anarcat CreditAttribution: anarcat commentedthat's really a feature request... :) and i think it would affect only Hosting (for now, we could also add support for postgres in the backend, but that's a whole different story).
It looks like the database initialisation fails, could you provide us with the errors that happen when you enable the hosting module? If the install profile doesn't show the errors, try uninstalling and reinstalling the hosting module.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedIf this is a feature request, I wonder if this could be made a duplicate of #269520: Move to PDO for all database access
Comment #3
anarcat CreditAttribution: anarcat commentedNope, this is not a dupe of #269520: Move to PDO for all database access which concerns only the backend managing mysql OR postgresql servers.
This issue here is about having the frontend (a regular drupal with almost regular modules) running on a PostgreSQL backend and should be fairly easy to implement. It doesn't depend on PDO.
Comment #4
mradcliffeThis is still in .4.
The issue is that you're using column names that are restricted. You need to quote 'user' in all queries for it to work. Simply changing the column name to something less-restrictive would be the solution as it uses best practices in Drupal. This would also be an issue with Oracle IIRC.
http://www.postgresql.org/docs/8.1/static/sql-keywords-appendix.html
I can try to work on a patch if nobody else has.
Comment #5
adrian CreditAttribution: adrian commentedmradcliffe , we'd happily commit that patch.
the only instance is see is in hosting_client_user , the user column should be renamed to 'uid'
Comment #6
mradcliffeOkay, I have a patch that should suffice for the hosting module frontend stuff.
Basic summary of changes:
Is the verify stuff part of the backend (i.e. look at the pdo/backend task)?
edit: removed that last question, easily answered.
Comment #7
anarcat CreditAttribution: anarcat commentedThis is really a request for review, thanks for your submission!
Comment #8
anarcat CreditAttribution: anarcat commentedSome problems with the patch:
Why this switch? Can't we just run this request anyways? It will not affect pgsql... Otherwise, isn't there a command specifically for that in the schema API?
SELECT user here will probably fail, i guess it should be select uid?
Floats need to be quoted in pgsql?
Comment #9
adrian CreditAttribution: adrian commentedThis is not how Drupal 6 db schema changes are made, read up on the schema api or check the last few updates in some of our .install files to find the fomula.
Comment #10
mradcliffeI'm really paranoid about $db_type ;-) But, yeah, it shouldn't be necessary. If for some reason it was run by postgresql it would spew a couple of errors.
My bad on forgetting about db_change_field().
The float needs to change because the schema says that 'version' is a text field. I was in the middle of turning that into '%s' and must have forgotten. Postgresql is strict about types and typecasting. I'm sure version field is supposed to be a text field for '6.x-dev' instances so it should be '%s'.
Comment #11
mradcliffeI forgot to update cvs, re-rolled. It shouldn't have mattered as it was able to merge.
Comment #12
adrian CreditAttribution: adrian commentedversion_code is an integer in the database, but is treated as a float in php, because php has a ridiculously small max_int_count but floats as big as you need.
it's only to get it into the database and is never used that way again.
Comment #13
adrian CreditAttribution: adrian commentedso you found a bug there , it should be :
but you need the %f for php to even be able to print the number.
Comment #14
anarcat CreditAttribution: anarcat commentedThe update_N() status lacks a comment.
The above comment by Adrian is unclear to me at this point: is this a bug with the patch on our side?
I also have yet to hear anyone has tested this patch on mysql, let alone pgsql (have you?).
Otherwise the patch looks sound, I'm just a bit worried about changing the fields like this without proper testing.
I'm maintaining a branch in git, at this point, the patch is here:
http://git.koumbit.net/?p=drupal/modules/hosting/.git;a=commitdiff_plain...
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedI got through the install with a postgres frontend, working pretty well.
However once the main aegir site was imported, the verify task failed and site went offline (that old case of the $_SERVER env stuff in the db_url string, but it hasn't yet modified the apache vhost to contain those environment settings. What caused that again? )
I fudged it and moved on.. trying to provision new sites, but they are trying to be provisioned with db_type of pgsql instead of mysql, so they too are failing.
I suspect it is that the database server node itself (in hosting_db_server table) has pgsql as its type. I didn't tell it to do this, it must be too smart for its own good and pick this up.
Comment #16
adrian CreditAttribution: adrian commenteddoesnt apply anymore.
Comment #17
Steven Jones CreditAttribution: Steven Jones commentedComment #18
ergonlogicNew features need to be implemented in Aegir 3.x, then we can consider back-porting to Aegir 2.x.