this patch add support for postgres

Comments

westwesterson’s picture

Status: Reviewed & tested by the community » Needs review

has this been tested on mysql too? This could potentially break mysql functionality. I think this should be tested before it is committed.

westwesterson’s picture

StatusFileSize
new16 KB

I am looking at a solution for this, but it may be best just to wait for the drupal 6 version, which will support any database thanks to the new database extraction layer in D6.

None the less, this is a patch , as of yet untested which proposes to add postgre support. I have left out the update functions from postgre, as there were no previous versions with postgre support, and they would have to be rewritten when the new patch comes out anyhow.

As of yet this is still untested. And this patch also fixes several other problems I found with the delete and install mechanism and table prefixes. This is very much an alpha patch. It will probably need work done, and needs to be tested in both postgre and mysql environments.

senpai’s picture

Title: support for postgres » Add support for Postgres databases
Status: Needs review » Needs work

I'd say that leaving this one alone for D6 to handle might be the wise move. I don't have a Postgres system to test things on, and the guys at work who do have that capability don't have the time to handle this type of patch. If Drupal 6's database layer can take care of this, maybe it'd be better to move forward on other pressing issues and let this one languish for a few months (or eternity).

Once 2.0 branches, all work on HEAD becomes D6 focused anyway, right?

westwesterson’s picture

Status: Needs work » Postponed

im postponing this

westwesterson’s picture

Status: Postponed » Needs work

upon further review of the Quiz 1.1 this functionality is already in use, if we do not include this feature it is an unexpected regression. So we need to support this, and an upgrade path.

miccil’s picture

StatusFileSize
new14.15 KB

I have a new patch for PostgreSQL support.
It's against current HEAD.

My testing environment is:
Client and developing platform: Windows XP Sp2
Server platform: PostgreSQL 8.0.13 on Gentoo Linux

For my env it seems work

miccil’s picture

I'm a question.
While I'm checking the code for PostgreSQL porting, I found in quiz.module
the following query

SELECT nr.nid, qnr.question_status 
FROM {quiz_node_relationship} qnr 
INNER JOIN {node_revisions} nr ON (qnr.parent_vid = nr.vid AND qnr.parent_nid = nr.nid)
WHERE qnr.parent_vid = %d AND qnr.parent_nid', $quiz_vid, $node->nid);

This query produce a PostgreSQL error. I have noted that for the two additional params
that follow the query there's only one % placeholder in the query string.
So I rewrote it as

SELECT nr.nid, qnr.question_status 
FROM {quiz_node_relationship} qnr 
INNER JOIN {node_revisions} nr ON (qnr.parent_vid = nr.vid AND qnr.parent_nid = nr.nid)
WHERE qnr.parent_vid = %d AND qnr.parent_nid = %d', $quiz_vid, $node->nid);

Is this ok or the correct version is:

SELECT nr.nid, qnr.question_status 
FROM {quiz_node_relationship} qnr 
INNER JOIN {node_revisions} nr ON (qnr.parent_vid = nr.vid AND qnr.parent_nid = nr.nid)
WHERE qnr.parent_vid = %d AND qnr.parent_nid IS NOT NULL', $quiz_vid, $node->nid);
westwesterson’s picture

Status: Needs work » Fixed

Your solution seems to work, while i can't verify that this works for postgre sql, it doesn't seem to change anything for mysql users. I am committing this so that it can be tested by postgresql users.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

  • Commit 04dea1f on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x by westwesterson:
    #180270 added pgsql support by miccil
    
    

  • Commit 04dea1f on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, quiz-pages by westwesterson:
    #180270 added pgsql support by miccil
    
    

  • Commit 04dea1f on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, quiz-pages, 2269219 by westwesterson:
    #180270 added pgsql support by miccil
    
    

  • Commit 04dea1f on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, 2269219 by westwesterson:
    #180270 added pgsql support by miccil