MySQL-specific queries - fail with pgsql
RockyRoad - March 7, 2009 - 19:44
| Project: | Site Documentation |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi,
I just tried sitedoc, but unfortunately it fails with following messages:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: unrecognized configuration parameter "grants" in /usr/local/share/drupal-6.10/includes/database.pgsql.inc on line 151.
* user warning: query: SHOW GRANTS in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 832.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "TABLE" LINE 1: SHOW TABLE STATUS ^ in /usr/local/share/drupal-6.10/includes/database.pgsql.inc on line 151.
* user warning: query: SHOW TABLE STATUS in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 885.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "FROM" LINE 1: SHOW INDEX FROM blocks ^ in /usr/local/share/drupal-6.10/includes/database.pgsql.inc on line 151.
* user warning: query: SHOW INDEX FROM blocks in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 1399.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: character varying = integer LINE 1: ...(theme) FROM blocks WHERE module='block' AND delta=1 LIMIT 1... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. in /usr/local/share/drupal-6.10/includes/database.pgsql.inc on line 151.
* user warning: query: SELECT COUNT(theme) FROM blocks WHERE module='block' AND delta=1 LIMIT 1 OFFSET 0 in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 1560.
* Orphan boxes found.I think none of those SHOW * statements are legal in ANSI SQL and should probably be moved to some abstraction layer.
Good luck .

#1
Surely there is a way to do this stuff with Postgres... There's not much point in even asking for the database section without this stuff.
Committed to 6.x only.
#2
Hi Nancy,
Thanks for the fix.
Unfortunaly, I still get errors with the head version:
* warning: explode() [function.explode]: Empty delimiter. in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 1493.* warning: explode() [function.explode]: Empty delimiter. in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 1493.
* warning: explode() [function.explode]: Empty delimiter. in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 1493.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: character varying = integer LINE 1: ...(theme) FROM blocks WHERE module='block' AND delta=1 LIMIT 1... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. in /usr/local/share/drupal-6.10/includes/database.pgsql.inc on line 151.
* user warning: query: SELECT COUNT(theme) FROM blocks WHERE module='block' AND delta=1 LIMIT 1 OFFSET 0 in /usr/local/share/drupal-6.10/sites/all/modules/sitedoc/sitedoc.module on line 1574.
* Orphan boxes found.
About the pg_query error, it's a datatype issue. This works fine:
SELECT COUNT(theme) FROM blocks WHERE module='block' AND delta='1' LIMIT 1 OFFSET 0;though the limit are not relevant here. Better written as:
SELECT COUNT(theme) FROM blocks WHERE (module='block') AND (delta='1');Be sure to use the single quote syntax for strings, as double quotes are used for column names in pgsql.
Best regards,
#3
I never commit to HEAD. I commit to DRUPAL-6--1.
#4
Thanks for your courtesy.
#5
It should already be in the -dev release. On any module you can check by using the "View CVS Messages" link on the project page. Those messages will show you which branches the commits are done against.
#6
I sent the comment #2, with changed issue version number, and different error report, after retesting on sitedoc-6.x-1.x-dev.tar.gz dated 2009-03-15 01:18, 42683 bytes, where sitedoc.module has md5sum 307365ed1e7bcd86c6c81b4a1e016282 . It has not changed since.
Many call their dev version HEAD, maybe it's not appropriate here, but that's not the purpose, I'm not using CVS for sitedoc.
Did you re-test the module ?
--
RockyRoad
#7
6.x-1.x-dev has an md5sum of "0eab456e39fe3acd2ff59dd9043de9be" according to the releases page. If you use the "Download" link next to 6.x-1.x-dev on the project page, you should get the corrected version.
If you see the following at line 840, you have the correct version:
if ($db_type == 'pgsql') {$output .= "</tr></table>";
return $output;
}
If you do see that, then I can assume that it is not working correctly. If you do not see that, you do not have the corrected version.
"HEAD" has a specific meaning in Drupal CVS. I use it only when building a version for a new Drupal. Therefore the HEAD version will not be changed until I start building DRUPAL-7--1, and I don't know when that will be.
Yes, I re-tested the module, but keep in mind that I do not have Postgres. I hope I changed it correctly, but that's something you will have to tell me. BTW, accusing a developer of not testing is a good way to anger them.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.