X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabasePostgres.php;h=d8be62f1f449c439dda9fc9317aaaa64abb6c05a;hb=6497541c9c089966ce7d3b0e0abd6b68192d30d8;hp=8aec1acaea9f237cab490fe84b0feb1c71a96b21;hpb=747bdd543d301e0816aa811806c6cc6b17ec1038;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 8aec1acaea..d8be62f1f4 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -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 ); @@ -819,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; } @@ -842,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 @@ -915,7 +922,7 @@ __INDEXATTR__; /** * Posted by cc[plus]php[at]c2se[dot]com on 25-Mar-2009 09:12 - * to https://secure.php.net/manual/en/ref.pgsql.php + * to https://www.php.net/manual/en/ref.pgsql.php * * Parsing a postgres array can be a tricky problem, he's my * take on this, it handles multi-dimensional arrays plus @@ -1346,10 +1353,6 @@ SQL; return [ $startOpts, $useIndex, $preLimitTail, $postLimitTail, $ignoreIndex ]; } - public function getServer() { - return $this->server; - } - public function buildConcat( $stringList ) { return implode( ' || ', $stringList ); } @@ -1462,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