Skip to content

pg_connect() shows outdated example for "options" #2690

@rgrellmann

Description

@rgrellmann

In "Example #1 Using pg_connect()" the last line shows the use of "options" in the connection string:
$dbconn5 = pg_connect("host=localhost options='--client_encoding=UTF8'");

In recent Versions of PHP/libpq/Postgres/pgbouncer this triggers the following Error:
pg_connect(): Unable to connect to PostgreSQL server: FATAL: unsupported options startup parameter: only '-c config=val' is allowed

Options can now be passed successfully only like this:
$dbconn5 = pg_connect("host=localhost options='-c client_encoding=UTF8 -c application_name=myapp'");

Please update the documentation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions