php / php/doc-en

pg_connect() shows outdated example for "options"

Open
#2,690 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: pgsql QA Waiting on Author
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find the “Example #1 Using pg_connect()” section in the PHP documentation and review its final connection-string example. Update the options syntax to use the shown “-c client_encoding=UTF8 -c application_name=myapp” form, then verify the example matches current PHP/libpq/PostgreSQL behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgresql
Domain
databases, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.