Jump to:

4951 Posts in 14058 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Postgresql on 2.4.1 and TRUNK

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2007 Views
  • Tony C
    Avatar
    Community Member
    9 Posts

    Postgresql on 2.4.1 and TRUNK Link to this post

    2 problems really, but both on the same platform (Linux, bitnami "LAPP" image) .

    1) First 2.4.1

    I get everything set up fine, create the database and the install.php sees that postgres is a valid option, but then ....

    [Warning] pg_query() [function.pg-query]: Query failed: ERROR: relation "SiteTree_versions" does not exist LINE 2: FROM "SiteTree_versions" GROUP BY "RecordID", "Version... ^
    POST /silverstripe-v2.4.1/install.php

    Line 174 in /opt/bitnami/apache2/htdocs/silverstripe-v2.4.1/postgresql/code/PostgreSQLDatabase.php

    Source

    165       if(isset($_REQUEST['previewwrite']) && in_array(strtolower(substr($sql,0,strpos($sql,' '))), array('insert','update','delete','replace'))) {
    166          Debug::message("Will execute: $sql");
    167          return;
    168       }
    169
    170       if(isset($_REQUEST['showqueries'])) {
    171          $starttime = microtime(true);
    172       }
    173
    174       $handle = pg_query($this->dbConn, $sql);
    175       
    176       if(isset($_REQUEST['showqueries'])) {
    177          $endtime = round(microtime(true) - $starttime,4);
    178          Debug::message("\n$sql\n{$endtime}ms\n", false);
    179       }
    180       

    Trace

    * pg_query(Resource id #1078,SELECT MIN("ID") AS "ID", "RecordID", "Version" FROM "SiteTree_versions" GROUP BY "RecordID", "Version" HAVING COUNT(*) > 1)
    Line 174 of PostgreSQLDatabase.php
    * PostgreSQLDatabase->query(SELECT MIN("ID") AS "ID", "RecordID", "Version" FROM "SiteTree_versions" GROUP BY "RecordID", "Version" HAVING COUNT(*) > 1,256)
    Line 127 of DB.php
    * DB::query(SELECT MIN("ID") AS "ID", "RecordID", "Version" FROM "SiteTree_versions" GROUP BY "RecordID", "Version" HAVING COUNT(*) > 1)
    Line 303 of Versioned.php
    * Versioned->augmentDatabase(,,,,,,)
    Line 963 of Object.php
    * Object->extend(augmentDatabase,)
    Line 3011 of DataObject.php
    * DataObject->requireTable()
    Line 209 of DatabaseAdmin.php
    * DatabaseAdmin->doBuild(1)
    Line 1056 of install.php
    * Installer->install(Array)
    Line 201 of install.php

    Am I guessing right that this is a case sensitivity problem on CREATE TABLE? I'm not really experienced with PHP so not sure where to look in the code foe the table names etc.

    2) Seond on silverstripe.2.0.DailyBuild.2010-08-12

    I don't get the option of postgresql, but then I'm not sure what module I need to load, and only tried this in the hope that it fixed (1).

    Happy to be testing this out for you guys, but I think I need some help!

  • gianca
    Avatar
    Community Member
    2 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    I am having the same issue. Not really sure what's happening.
    Please let me know if you found any solution.

    Regards,

    Giancarlo

  • gianca
    Avatar
    Community Member
    2 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    Ok, solved... in a certain way.
    What I did was to install the 2.4.0 version first, and then upgrade it to current version.

    1) Download version 2.4.0 here:
    http://www.silverstripe.org/assets/downloads/SilverStripe-v2.4.0.tar.gz

    2) Install it with PostgreSql Plug-in, it will work fine.

    3) Rebuild application. /dev/build/?flush=all

    4) Delete directories googlesitemaps, cms and sapphire, and copy the update versions of them in version 2.4.1. Setup directory access and permissions as necessary.

    5) Rebuild applicacion /dev/build/?flush=all

    That should work, so far works fine for me.

  • Tony C
    Avatar
    Community Member
    9 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    Good job!

    Thanks for helping out there - I'll try to get it running over the w/e, and I guess I should report this as a bug unless it's been reported already?

  • Rhyous
    Avatar
    Community Member
    7 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    Doesn't look like this was fixed in 2.4.2. I am getting the same issue.

  • Tony C
    Avatar
    Community Member
    9 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    I think there are also a few other dramas with the Sapphire Framework and PostgreSQL namely GROUP BYs.

    I have temporarily moved to MySQL until these are resloved.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    Where are you seeing this? Our automated unit tests are passing with the trunk version of the postgresql module for SilverStripe...

    0.9.1, I believe, has some issues with 2.4.2... so you should try using the trunk release instead.

  • Tony C
    Avatar
    Community Member
    9 Posts

    Re: Postgresql on 2.4.1 and TRUNK Link to this post

    Hi Sean,

    Apologies, I haven't tried with trunk yet, but if it works with a fresh install that's great news.

    The deeper problem I had was to do with the GROUP BY, which I posted separately. It's a bit long winded and involves the third party ecommerce module, which is why maybe no one replied to it. I believe I tracked it down to an internal sapphire problem, but I just don't have a clue how to fix it. Once that gets figured out I'm going to send some patches to the ecommerce developer to enable full postgres support. In the meantime I'm stuck with MySQL.

    See http://silverstripe.org/data-model-questions/show/292392#post292392

    Cheers,

    Tony.

    2007 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.