Gitea cannot be installed on posgresql schema different to public #3624

Closed
opened 2025-11-02 05:19:56 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @Rizzen59 on GitHub (Jul 19, 2019).

  • Gitea version (or commit ref): 1.8.3 and 1.9.0-rc2
  • Git version: 2.22.0
  • Operating system: CentOS 7
  • Database (use [x]):
    • PostgreSQL (11)
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • Not relevant
    • No
  • Log gist:

Description

If default schema for user is different of public (the best way), schema is created on gitea on the user default schema.
On boot, the check for existing column id on table version is executed on schema public , then gitea try to add column but column already exist on user's default schema and crash.

Log :
SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id]

Originally created by @Rizzen59 on GitHub (Jul 19, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.8.3 and 1.9.0-rc2 - Git version: 2.22.0 - Operating system: CentOS 7 - Database (use `[x]`): - [x] PostgreSQL (11) - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] Not relevant - [ ] No - Log gist: ## Description If default schema for user is different of public (the best way), schema is created on gitea on the user default schema. On boot, the check for existing column id on table version is executed on schema public , then gitea try to add column but column already exist on user's default schema and crash. Log : SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [**public** version id]
GiteaMirror added the issue/duplicate label 2025-11-02 05:19:56 -06:00
Author
Owner

@lafriks commented on GitHub (Jul 19, 2019):

I think there was issue for this already, there was even draft PR to fix this but it never got finished

@lafriks commented on GitHub (Jul 19, 2019): I think there was issue for this already, there was even draft PR to fix this but it never got finished
Author
Owner

@lunny commented on GitHub (Jul 20, 2019):

duplicated with #5152

@lunny commented on GitHub (Jul 20, 2019): duplicated with #5152
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3624