Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Installing SilverStripe /

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

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

Postgresql on 2.4.1 and TRUNK

Go to End

9 Posts   2909 Views

Tony C

Community Member, 9 Posts

12 August 2010 at 6:39pm

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() []: 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


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 }
170 if(isset($_REQUEST['showqueries'])) {
171 $starttime = microtime(true);
172 }
174 $handle = pg_query($this->dbConn, $sql);
176 if(isset($_REQUEST['showqueries'])) {
177 $endtime = round(microtime(true) - $starttime,4);
178 Debug::message("\n$sql\n{$endtime}ms\n", false);
179 }


* 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!


Community Member, 2 Posts

13 August 2010 at 9:47am

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




Community Member, 2 Posts

13 August 2010 at 5:10pm

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:

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

Community Member, 9 Posts

13 August 2010 at 5:25pm

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?


Community Member, 7 Posts

10 October 2010 at 5:59pm

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

Tony C

Community Member, 9 Posts

10 October 2010 at 6:18pm

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.


Forum Moderator, 922 Posts

10 October 2010 at 6:29pm

Edited: 10/10/2010 6:30pm

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

Community Member, 9 Posts

10 October 2010 at 6:46pm

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.




Go to Top