Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass PostgreSQL connection params #28083

Closed
PKizzle opened this issue Nov 16, 2023 · 3 comments · Fixed by #28085
Closed

Unable to pass PostgreSQL connection params #28083

PKizzle opened this issue Nov 16, 2023 · 3 comments · Fixed by #28085
Labels

Comments

@PKizzle
Copy link

PKizzle commented Nov 16, 2023

Description

With the recent changes in https://github.com/go-gitea/gitea/blame/79394b340d227182f94bae48cb08a091c78f2ea2/modules/setting/database.go#L160C6-L160C35 it is no longer possible to specify custom connection parameters like binary_parameters=yes by appending them to the Database.Name.
Instead of the actual parameters the parameter separator is passed to getPostgreSQLConnectionString.

Gitea Version

v1.21.0

Can you reproduce the bug on the Gitea demo site?

No - irrelevant since issue is configuration related

How are you running Gitea?

Helm chart v9.5.1 on Kubernetes cluster v1.28.3

Database

PostgreSQL

@lunny
Copy link
Member

lunny commented Nov 16, 2023

related #27723

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 16, 2023

-> Fix incorrect pgsql conn builder behavior #28085

I guess you meant that Name = "name?key=val", while it's better to provide your real config example, it would help to clarify the problem.

@PKizzle
Copy link
Author

PKizzle commented Nov 16, 2023

I need to add this parameter in order to connect to the PostgreSQL database via pgbouncer.

My database is named gitea hence I set NAME to gitea?binary_parameters=yes.

silverwind pushed a commit that referenced this issue Nov 17, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Nov 17, 2023
silverwind pushed a commit that referenced this issue Nov 17, 2023
Backport #28085 by @wxiaoguang

Fix #28083 and fix the tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2024
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants