only show privileges that a particular version of postgres supports
authorchriskl <chriskl>
Fri, 14 Mar 2003 03:14:49 +0000 (03:14 +0000)
committerchriskl <chriskl>
Fri, 14 Mar 2003 03:14:49 +0000 (03:14 +0000)
classes/database/Postgres.php
classes/database/Postgres71.php
classes/database/Postgres72.php
classes/database/Postgres73.php

index b5cb0e246839593850d84ee75b2bb102887cc012..a280aa524a8d363799937eb188435f64141d1e39 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.58 2003/03/12 05:25:30 chriskl Exp $
+ * $Id: Postgres.php,v 1.59 2003/03/14 03:14:49 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -75,13 +75,9 @@ class Postgres extends BaseDB {
        // List of all legal privileges that can be applied to different types
        // of objects.
        var $privlist = array(
-               'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'RULE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
-               'view' => array('SELECT', 'RULE', 'ALL PRIVILEGES'),
-               'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES'),
-               'database' => array('CREATE', 'TEMPORARY', 'ALL PRIVILEGES'),
-               'function' => array('EXECUTE', 'ALL PRIVILEGES'),
-               'language' => array('USAGE', 'ALL PRIVILEGES'),
-               'schema' => array('CREATE', 'USAGE', 'ALL PRIVILEGES')
+               'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'RULE', 'ALL'),
+               'view' => array('SELECT', 'RULE', 'ALL'),
+               'sequence' => array('SELECT', 'UPDATE', 'ALL')
        );
 
        // List of characters in acl lists and the privileges they
index 8ec6b4a89f56fb7174db567c56a6c9bf19f6ed4c..05965fc18c20a09140cf8f97eb1e6553893decc5 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres71.php,v 1.23 2003/03/10 02:15:15 chriskl Exp $
+ * $Id: Postgres71.php,v 1.24 2003/03/14 03:14:51 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -16,6 +16,14 @@ class Postgres71 extends Postgres {
        var $_lastSystemOID = 18539;
        var $_maxNameLen = 31;
 
+       // List of all legal privileges that can be applied to different types
+       // of objects.
+       var $privlist = array(
+               'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'RULE', 'ALL'),
+               'view' => array('SELECT', 'RULE', 'ALL'),
+               'sequence' => array('SELECT', 'UPDATE', 'ALL')
+       );
+
        function Postgres71($host, $port, $database, $user, $password) {
                $this->Postgres($host, $port, $database, $user, $password);
        }
index 36da59c4cbf48f38db6c9366b999a6974338cf0e..9d1be2e0551637058691a2bea0c22bd577fd5783 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres72.php,v 1.26 2003/02/09 09:23:39 chriskl Exp $
+ * $Id: Postgres72.php,v 1.27 2003/03/14 03:14:52 chriskl Exp $
  */
 
 
@@ -16,9 +16,17 @@ class Postgres72 extends Postgres71 {
        var $langFields = array('lanname' => 'lanname');
        var $privFields = array('privarr' => 'relacl');
 
-       // @@ Set the maximum built-in ID. Should we bother querying for this?
+       // Set the maximum built-in ID.
        var $_lastSystemOID = 16554;
 
+       // List of all legal privileges that can be applied to different types
+       // of objects.
+       var $privlist = array(
+               'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'RULE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
+               'view' => array('SELECT', 'RULE', 'ALL PRIVILEGES'),
+               'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES')
+       );
+
        // This gets it from the database.
        // $rs = pg_exec($link, "SELECT oid FROM pg_database WHERE datname='template1'") or pg_die(pg_errormessage(), "", __FILE__, __LINE__);
        // $builtin_max = pg_result($rs, 0, "oid");
index 4d17d8933aa076233101e336d1155b858e8e412e..728621b4d4c46649aeb4a8609bdbe025111661e9 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.23 2003/03/12 05:25:03 chriskl Exp $
+ * $Id: Postgres73.php,v 1.24 2003/03/14 03:14:53 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -29,6 +29,18 @@ class Postgres73 extends Postgres72 {
        var $_schemaOIDs = array(11, 99);
        var $_schemaNames = array('pg_catalog', 'pg_toast');
 
+       // List of all legal privileges that can be applied to different types
+       // of objects.
+       var $privlist = array(
+               'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'RULE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
+               'view' => array('SELECT', 'RULE', 'ALL PRIVILEGES'),
+               'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES'),
+               'database' => array('CREATE', 'TEMPORARY', 'ALL PRIVILEGES'),
+               'function' => array('EXECUTE', 'ALL PRIVILEGES'),
+               'language' => array('USAGE', 'ALL PRIVILEGES'),
+               'schema' => array('CREATE', 'USAGE', 'ALL PRIVILEGES')
+       );
+
        function Postgres73($host, $port, $database, $user, $password) {
                $this->Postgres72($host, $port, $database, $user, $password);
        }