Skip to content

fix(database): percent-encode spaces in Postgres connection URI#9685

Merged
Gnanasundari24 merged 1 commit intomainfrom
psql/fix
Oct 6, 2025
Merged

fix(database): percent-encode spaces in Postgres connection URI#9685
Gnanasundari24 merged 1 commit intomainfrom
psql/fix

Conversation

@bsayak03
Copy link
Contributor

@bsayak03 bsayak03 commented Oct 6, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Currently with Postgres@18, db connection fails. Reason being space should be percent encoded as %20. This encoding standards are followed across all versions of Postgres as mentioned in their docs as well.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Created a API Key using Hyperswitch curls:

cURL:

curl --location 'http://localhost:8080/api_keys/merchant_1759751745' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
  "name": "API Key 1",
  "description": null,
  "expiration": "2038-01-19T03:14:08.000Z"
}'

Response:

{
    "key_id": "dev_B0IKCHN3tOmvjIA8m30P",
    "merchant_id": "merchant_1759751745",
    "name": "API Key 1",
    "description": null,
    "api_key": "dev_rzf4iZbDCXjdUAV5azsJQ2p6J38lseesvbJaKPLdkfusiDNOG1WrsZVliSklF0ls",
    "created": "2025-10-06T12:19:05.958Z",
    "expiration": "2038-01-19T03:14:08.000Z"
}
Screenshot 2025-10-06 at 5 28 46 PM Screenshot 2025-10-06 at 5 49 42 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@bsayak03 bsayak03 requested a review from a team as a code owner October 6, 2025 10:17
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 6, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/common_utils/src/lib.rs  0% smaller

@bsayak03 bsayak03 self-assigned this Oct 6, 2025
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

This seems to be enforced by PostgreSQL 18. Can you confirm if this change works correctly with previous versions of Postgres (13 to 17)?

@bsayak03 bsayak03 changed the title fix: Encode spaces in Postgres connection URL fix(framework): Encode spaces in Postgres connection URL Oct 6, 2025
@bsayak03
Copy link
Contributor Author

bsayak03 commented Oct 6, 2025

This seems to be enforced by PostgreSQL 18. Can you confirm if this change works correctly with previous versions of Postgres (13 to 17)?

Tried with Postgres@14. attached the screenshots for ref

@SanchithHegde SanchithHegde changed the title fix(framework): Encode spaces in Postgres connection URL fix(database): percent-encode spaces in Postgres connection URI Oct 6, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Oct 6, 2025
Merged via the queue into main with commit dbc113f Oct 6, 2025
40 of 48 checks passed
@Gnanasundari24 Gnanasundari24 deleted the psql/fix branch October 6, 2025 18:21
pixincreate added a commit that referenced this pull request Oct 7, 2025
…esouro-googlepay

* 'main' of github.com:juspay/hyperswitch:
  feat(connector): [tesouro] apple pay (#9648)
  fix(payments): update error handling for payment void v2 (#9595)
  fix(connectors): [Nexixpay] MIT & order_id fix (#9644)
  chore(version): 2025.10.07.0
  fix(database): percent-encode spaces in Postgres connection URI (#9685)
  chore(version): 2025.10.06.0
  feat(subscriptions): Invoice record back workflow (#9529)
  feat: Implement subscriptions workflow and incoming webhook support (#9400)
  Feat(Customer): Added search Feature to the Customer Page (#9619)
  chore(version): 2025.10.02.0
  feat(subscription): Add support to call payments microservice from subscription service via payments API client (#9590)
UdayPandey01 pushed a commit to UdayPandey01/hyperswitch that referenced this pull request Oct 8, 2025
…ay#9685)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
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.

4 participants