Intermediate support for Postgres 90/91
authorRobert Treat <robert@omniti.com>
Tue, 29 May 2012 02:29:30 +0000 (22:29 -0400)
committerRobert Treat <robert@omniti.com>
Tue, 29 May 2012 02:29:30 +0000 (22:29 -0400)
classes/database/Connection.php
classes/database/Postgres.php
classes/database/Postgres90.php [new file with mode: 0755]

index 16b2abc7c0ad78bbcda8146e797efd5294792726..6733e535da35b72744abd7ef068d9aba35d54e53 100755 (executable)
@@ -76,7 +76,9 @@ class Connection {
 
                // Detect version and choose appropriate database driver
                switch (substr($version,0,3)) {
-                       case '8.4': return 'Postgres'; break;
+                       case '9.1': return 'Postgres'; break;
+                       case '9.0': return 'Postgres90'; break;
+                       case '8.4': return 'Postgres84'; break;
                        case '8.3': return 'Postgres83'; break;
                        case '8.2': return 'Postgres82'; break;
                        case '8.1': return 'Postgres81'; break;
@@ -86,7 +88,7 @@ class Connection {
                }
 
                /* All <7.4 versions are not supported */
-               // if major version is 7 or less and wasn't catch in the
+               // if major version is 7 or less and wasn't cought in the
                // switch/case block, we have an unsupported version.
                if ((int)substr($version, 0, 1) < 8)
                        return null;
index d2c00603cf11b0e61385d6eceab3e69489c96a51..bd7e3f2965f9a6596e0aff7927574b054b5e9141 100755 (executable)
@@ -11,7 +11,7 @@ include_once('./classes/database/ADODB_base.php');
 
 class Postgres extends ADODB_base {
 
-       var $major_version = 9.0;
+       var $major_version = 9.1;
        // Max object name length
        var $_maxNameLen = 63;
        // Store the current schema
@@ -415,7 +415,7 @@ class Postgres extends ADODB_base {
        }
 
        function getHelpPages() {
-               include_once('./help/PostgresDoc90.php');
+               include_once('./help/PostgresDoc91.php');
                return $this->help_page;
        }
 
diff --git a/classes/database/Postgres90.php b/classes/database/Postgres90.php
new file mode 100755 (executable)
index 0000000..3f48d30
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * PostgreSQL 9.0 support
+ *
+ * $Id: Postgres82.php,v 1.10 2007/12/28 16:21:25 ioguix Exp $
+ */
+
+include_once('./classes/database/Postgres.php');
+
+class Postgres90 extends Postgres {
+
+       var $major_version = 9.0;
+
+       /**
+        * Constructor
+        * @param $conn The database connection
+        */
+       function Postgres90($conn) {
+               $this->Postgres($conn);
+       }
+
+       // Help functions
+
+       function getHelpPages() {
+               include_once('./help/PostgresDoc90.php');
+               return $this->help_page;
+       }
+
+       // Capabilities
+
+}
+?>