$connectVars['port'] = (int)$this->port;
}
if ( $this->flags & self::DBO_SSL ) {
- $connectVars['sslmode'] = 1;
+ $connectVars['sslmode'] = 'require';
}
$this->connectString = $this->makeConnectionString( $connectVars );
return true;
}
+ protected function makeUpdateOptionsArray( $options ) {
+ if ( !is_array( $options ) ) {
+ $options = [ $options ];
+ }
+
+ // PostgreSQL doesn't support anything like "ignore" for
+ // UPDATE.
+ $options = array_diff( $options, [ 'IGNORE' ] );
+
+ return parent::makeUpdateOptionsArray( $options );
+ }
+
/**
* INSERT SELECT wrapper
* $varMap must be an associative array of the form [ 'dest1' => 'source1', ... ]
$newNameE = $this->addIdentifierQuotes( $newName );
$oldNameE = $this->addIdentifierQuotes( $oldName );
- $ret = $this->query( 'CREATE ' . ( $temporary ? 'TEMPORARY ' : '' ) . " TABLE $newNameE " .
+ $temporary = $temporary ? 'TEMPORARY' : '';
+
+ $ret = $this->query( "CREATE $temporary TABLE $newNameE " .
"(LIKE $oldNameE INCLUDING DEFAULTS INCLUDING INDEXES)", $fname );
if ( !$ret ) {
return $ret;
$fieldE = $this->addIdentifierQuotes( $field );
$newSeqE = $this->addIdentifierQuotes( $newSeq );
$newSeqQ = $this->addQuotes( $newSeq );
- $this->query( 'CREATE ' . ( $temporary ? 'TEMPORARY ' : '' ) . " SEQUENCE $newSeqE", $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