Incompatibility with Postgresql

xaweryz - April 3, 2008 - 12:20
Project:Super Nav
Version:6.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

ERROR:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "1" does not exist in /company/users/daniel/public_html/cms/drupal-6.1/includes/database.pgsql.inc on line 138.
    * user warning: query: SELECT * FROM drupal_supernav_user_settings WHERE uid="1" in /company/users/daniel/public_html/cms/drupal-6.1/sites/all/modules/supernav/supernav.module on line 218.
    * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "1" does not exist in /company/users/daniel/public_html/cms/drupal-6.1/includes/database.pgsql.inc on line 138.
    * user warning: query: SELECT * FROM drupal_supernav_user_settings WHERE uid="1" in /company/users/daniel/public_html/cms/drupal-6.1/sites/all/modules/supernav/supernav.module on line 218.

Example:

Line: 217

$sql = 'SELECT * FROM {supernav_user_settings} WHERE uid="%d" ';   #bad SQL

double commas is taken as column!!
please change all double commas to single commas in all SQLs
$sql = "SELECT * FROM {supernav_user_settings} WHERE uid='%d' ";  #SQL is OK

#1

kevinwal - May 2, 2008 - 19:35

I've fixed the 5.x version for postgreSQL. It's functioning properly for me although I don't have time to do a real test. Please test this before using!

AttachmentSize
supernav5xPostgresql.zip 99.72 KB

#2

kanonier - July 1, 2008 - 12:22

Also you need change your INSERT-queries from style:
INSERT INTO tablename SET columnname='columnvalue'
to style:
INSERT INTO tablename(columnname) VALUES('columnvalue')

first style don't working with postgresql. And another thing - not needed quotas near values for integer columns.

In attachement - my patched 6th version. Not good way - I'm replace double-quoting by str_replace :) For me it was more easy :)

AttachmentSize
supernav6xPostgresql.zip 105.36 KB

#3

chrisshattuck - November 6, 2008 - 00:11

Please see http://drupal.org/node/285027#comment-1094346. I may need to do some work on the new module to work with Postgresql. Thank you for the patch work!

 
 

Drupal is a registered trademark of Dries Buytaert.