Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DatabasePostgres.php
index 381b1fd..3041a33 100644 (file)
@@ -116,7 +116,7 @@ class DatabasePostgres extends Database {
                        $connectVars['port'] = (int)$this->port;
                }
                if ( $this->flags & self::DBO_SSL ) {
-                       $connectVars['sslmode'] = 1;
+                       $connectVars['sslmode'] = 'require';
                }
 
                $this->connectString = $this->makeConnectionString( $connectVars );
@@ -216,6 +216,10 @@ class DatabasePostgres extends Database {
                        !preg_match( '/^SELECT\s+pg_(try_|)advisory_\w+\(/', $sql );
        }
 
+       /**
+        * @param string $sql
+        * @return bool|mixed|resource
+        */
        public function doQuery( $sql ) {
                $conn = $this->getBindingHandle();
 
@@ -815,8 +819,12 @@ __INDEXATTR__;
 
                $temporary = $temporary ? 'TEMPORARY' : '';
 
-               $ret = $this->query( "CREATE $temporary TABLE $newNameE " .
-                       "(LIKE $oldNameE INCLUDING DEFAULTS INCLUDING INDEXES)", $fname );
+               $ret = $this->query(
+                       "CREATE $temporary TABLE $newNameE " .
+                               "(LIKE $oldNameE INCLUDING DEFAULTS INCLUDING INDEXES)",
+                       $fname,
+                       $this::QUERY_PSEUDO_PERMANENT
+               );
                if ( !$ret ) {
                        return $ret;
                }
@@ -838,7 +846,10 @@ __INDEXATTR__;
                        $fieldE = $this->addIdentifierQuotes( $field );
                        $newSeqE = $this->addIdentifierQuotes( $newSeq );
                        $newSeqQ = $this->addQuotes( $newSeq );
-                       $this->query( "CREATE $temporary SEQUENCE $newSeqE OWNED BY $newNameE.$fieldE", $fname );
+                       $this->query(
+                               "CREATE $temporary SEQUENCE $newSeqE OWNED BY $newNameE.$fieldE",
+                               $fname
+                       );
                        $this->query(
                                "ALTER TABLE $newNameE ALTER COLUMN $fieldE SET DEFAULT nextval({$newSeqQ}::regclass)",
                                $fname
@@ -1342,10 +1353,6 @@ SQL;
                return [ $startOpts, $useIndex, $preLimitTail, $postLimitTail, $ignoreIndex ];
        }
 
-       public function getServer() {
-               return $this->server;
-       }
-
        public function buildConcat( $stringList ) {
                return implode( ' || ', $stringList );
        }
@@ -1458,6 +1465,10 @@ SQL;
                return $row ? ( strtolower( $row->default_transaction_read_only ) === 'on' ) : false;
        }
 
+       public static function getAttributes() {
+               return [ self::ATTR_SCHEMAS_AS_TABLE_GROUPS => true ];
+       }
+
        /**
         * @param string $lockName
         * @return string Integer