Hi,

I had some problem to make this module run with Postgres 7.4

It seems the version of Postgres that I'm using is not possible to use double quotes (") in the queries to specify a language.

with the original code, for example...

languageinterface.module
...
(195) $defaulttext = db_result(db_query('SELECT native FROM {languages} WHERE language = "%s"', $lang));
...

It was giving some warnings...

# warning: pg_query(): Query failed: ERROR: column "en" does not exist in c:\...\includes\database.pgsql.inc on line 139.
# user warning: query: SELECT native FROM languages WHERE language = "en" in c:\...\sites\all\modules\languageinterface\languageinterface.module on line 195.

Changing the double quotes for simple quotes might solve the problem (at least for me)

languageinterface.module
...
(195) $defaulttext = db_result(db_query('SELECT native FROM {languages} WHERE language = \'%s\'', $lang));
...

hope it helps someone :)

CommentFileSizeAuthor
#6 385526.patch1.23 KBJolidog
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PixelClever’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

testosterone_z’s picture

Title: Problems with Postgres 7.4 » Problems with Postgres (and any SQL standard compliant database)
Version: 6.x-2.1 » 6.x-2.3
Priority: Normal » Critical

The MySQL-specific SQL statements still persist in Version 6.x-2.3.

In file "languageinterface.module", lines 344, 351 and 442. "%s" should get replaced by \'%s\' (escaped single quotes) or the statements should get wrapped with double quotes and the %s with single quotes.

Thanks in advance.

testosterone_z’s picture

Status: Closed (fixed) » Active
testosterone_z’s picture

Status: Active » Needs work
Jolidog’s picture

Status: Needs work » Needs review
FileSize
1.23 KB

Changed the lines indicated by testosterone_z to statements wrapped with double quotes and the %s with single quotes.
I can't test this with Postgres, so someone who can, please report back.

Thanks