Skip to content

Update postgresHasDefault() error message to document libpq defaults#553

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/align-postgres-default-settings
Draft

Update postgresHasDefault() error message to document libpq defaults#553
Copilot wants to merge 4 commits intomainfrom
copilot/align-postgres-default-settings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 21, 2026

The postgresHasDefault() error message previously implied all PG* env vars must be defined. Updated to clarify that libpq has sensible defaults and env vars are optional overrides.

postgresHasDefault() error message

Old message stated users must define PGHOST, PGPORT, PGUSER, PGPASSWORD, and PGDATABASE. Updated to clarify:

  • These env vars are optional overrides, not requirements
  • libpq provides sensible defaults (local connection, port 5432, OS user name)
  • Links to libpq connection parameter documentation

No changes to dbConnect() — it remains fully deterministic.

Original prompt

This section details on the original issue you should resolve

<issue_title>Align postgresDefault() with other Postgres libraries</issue_title>
<issue_description>Do we want to respect libpq and psql defaults in postgresDefault() for alignment with other libraries? How do the Python, Go, Rust, Node, Julia clients do this?

</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits February 21, 2026 10:31
Update documentation to accurately reflect libpq's full default chain:
- dbname: mention PGDATABASE env var, then fallback to user name
- user: add OS username fallback when PGUSER is not set
- host,port: add libpq defaults (Unix socket, port 5432) when env vars unset
- service: add PGSERVICE env var mention
- postgresHasDefault(): clarify not all env vars are required

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copilot AI changed the title [WIP] Align postgresDefault() with other Postgres libraries Align postgresDefault() docs with libpq defaults Feb 21, 2026
Copilot AI requested a review from krlmlr February 21, 2026 10:32
Copy link
Copy Markdown
Member

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot dbConnect should be fully deterministic and does not need to change. Only postgresDefault() and ...HasDef... should change. The documentation of dbConnect can point to the latter.

…ssage

Per reviewer feedback, dbConnect should remain fully deterministic.
Only the postgresHasDefault() error message in default.R is updated
to clarify libpq defaults. All changes to dbConnect_PqDriver.R and
generated man pages are reverted.

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 21, 2026

@copilot dbConnect should be fully deterministic and does not need to change. Only postgresDefault() and ...HasDef... should change. The documentation of dbConnect can point to the latter.

Reverted all dbConnect_PqDriver.R and man page changes in 7b95542. Only postgresHasDefault() error message in R/default.R is updated now.

Copilot AI changed the title Align postgresDefault() docs with libpq defaults Update postgresHasDefault() error message to document libpq defaults Feb 21, 2026
Copilot AI requested a review from krlmlr February 21, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align postgresDefault() with other Postgres libraries

2 participants