Skip to content

Hyperdrive: clarify application_name for drivers that set their own (e.g. Postgres.js)#32108

Open
ivoryibu wants to merge 1 commit into
cloudflare:productionfrom
ivoryibu:hyperdrive-appname-postgresjs-note
Open

Hyperdrive: clarify application_name for drivers that set their own (e.g. Postgres.js)#32108
ivoryibu wants to merge 1 commit into
cloudflare:productionfrom
ivoryibu:hyperdrive-appname-postgresjs-note

Conversation

@ivoryibu

Copy link
Copy Markdown
Collaborator

Summary

Clarifies the "Identify connections from Hyperdrive" section of the Connect to PostgreSQL page.

The current text states unconditionally that Hyperdrive connections appear as application_name = 'Cloudflare Hyperdrive' in pg_stat_activity. That is only true for drivers that do not set their own application_name (for example, node-postgres/pg).

Some drivers send a default application_name in the Postgres startup packet. Postgres.js defaults to postgres.js (env.PGAPPNAME || 'postgres.js'). Hyperdrive forwards that client-supplied value to the database, so those connections show up as postgres.js — leading users to believe they are bypassing Hyperdrive when they are not.

Reproduction

Same Hyperdrive config and database, comparing drivers via SELECT application_name FROM pg_stat_activity WHERE pid = pg_backend_pid():

Driver application_name seen by Postgres
pg (node-postgres) Cloudflare Hyperdrive
postgres.js + Drizzle postgres.js
postgres.js + Drizzle, connection.application_name overridden Cloudflare Hyperdrive

Change

Adds a note explaining the behavior and showing how to set application_name explicitly with Postgres.js so connections remain identifiable as Hyperdrive.

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review

💡 1 suggestion found in commit c225449.

Fix in your agent
Fix the following review findings in PR #32108 (https://github.com/cloudflare/cloudflare-docs/pull/32108).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, fix all legitimate findings. For any you decide to skip,
post a comment on this PR with the finding ID and your reasoning.

---

## Style Guide Review

### Suggestions (1)

#### SG-679c4a0f5ca3 · Use TypeScriptExample component for TypeScript code blocks
- **File:** `src/content/docs/hyperdrive/examples/connect-to-postgres/index.mdx` line 97
- **Issue:** Added raw ```ts fenced block in a docs MDX file
- **Fix:** Use <TypeScriptExample> instead; it auto-generates a JS tab from the TypeScript source.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

No convention issues found.

Style Guide Review

Suggestions (1)
File Issue
hyperdrive/examples/connect-to-postgres/index.mdx line 97 Use TypeScriptExample component for TypeScript code blocks — Added raw ```ts fenced block in a docs MDX file Fix: Use instead; it auto-generates a JS tab from the TypeScript source.
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.

@github-actions github-actions Bot added product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ size/s labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants