In PostgreSQL, queries strings have to be enclosed in apostrophes ('), quotation mark (") does not work. Please fix it.

Thanx,
Gabor

CommentFileSizeAuthor
#1 page_title_pg.patch3.29 KBvalthebald
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valthebald’s picture

Status: Needs work » Needs review
FileSize
3.29 KB

People, please!
The world is not stuck to mysql :)
Please find attached patch against 6.x-2.3

Andy Dorman’s picture

FWIW, I just applied the patch to a new install using 6.x-2.3 and it works great with PgSQL 8.4

nicholasThompson’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Needs review » Patch (to be ported)

Thanks guys - I've never used PostgreSQL so have no experience (or system) for testing this.

I have applied a similar fix to that in your patch (I actually just switched the single and double quotes around... Works on MySQL and looks like it achieves the same thing as your patch).

Marking as TBP...

beasley’s picture

Just tried the dev version on PostgreSQL 8.1.19 and it works fine.

nicholasThompson’s picture

Thanks Beasley :)

beasley’s picture

No problem. Thanks for the really useful module!

John Franklin’s picture

This patch has been sitting around for a full eight months. Can we please get this into a release soon?

davidwhthomas’s picture

This module uses invalid SQL syntax which breaks on postgres.

Basically, quote marks are around the wrong way

db_query('DELETE FROM {page_title} WHERE type = "term" AND id = %d', $edit['tid']);

should be

db_query("DELETE FROM {page_title} WHERE type = 'term' AND id = %d", $edit['tid']);

In all cases.

In then works fine on mysql and postgres.

Without this, postgres users see constant error messages on screen.

Otherwise, a useful module, thanks.

onewomanbiz’s picture

Where / how have you used this patch?

I tried the patch through the PGSQL interface and came up with a pgsql error in the code.

I tried looking at database.pgsql.inc line 139, and dreamweaver'd the whole file looking for erroneous " to change them manually to ', everything is already apostrophed.

warning: pg_query(): Query failed: ERROR: column "node" does not exist in /includes/database.pgsql.inc on line 139.

warning: pg_query(): Query failed: ERROR: column "user" does not exist in /includes/database.pgsql.inc on line 139.

warning: pg_query(): Query failed: ERROR: column "timezone_id" of relation "users" does not exist in /includes/database.pgsql.inc on line 139

I get error node column doesn't exist, time_zone column not found...all basically the same error in line 139 database.pgsql.inc.

Any suggestions?

nicholasThompson’s picture

Status: Patch (to be ported) » Fixed

This is fixed in both D6 and D7 - as far as I know.

valthebald’s picture

confirm - D6 version works with postgres 8.4

nicholasThompson’s picture

thank you valthebald :)

Status: Fixed » Closed (fixed)

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