protected function getServerVersionPromised() {
        $sql = "SELECT VERSION()";
        return $this->db->createCommand($sql)->queryScalar()->then(
            function($result) {
                $version = preg_match('/PostgreSQL\s?([\d\.\w]+)/', $result, $matches) ? $matches[1] : null;
                $this->_serverVersion = $version;
                return $version;
            }
        );
    }