public function connect() {
        $count = 0;
        do {
            $count += 1;
            $this->Resource = pg_connect($this->getConnectionString());
            if ($this->Resource !== false) {
                return true;
            }
        } while ($count < $this->getConnectTries());

        throw new TriesOverConnectException();
    }