I'm doing this
$conn_str =
'host=\''.pg_escape_string($host).
'\' user=\''.pg_escape_string($user).
'\' password=\''.pg_escape_string($password).
'\' dbname=\''.pg_escape_string($database).'\''
;
$this->handler = pg_pconnect($conn_str);
And whenever $password has a single quote in it I get an error like this:
Unable to connect to PostgreSQL server: missing "=" after "''" in connection info string
What is the proper way to format a PgSQL connection info string?