-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
gitea does not start - can not find public schema #5152
Comments
#3348 tried to resolve the problem. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
There is the issue with gitea 1.8.3 and 1.9.0-rc2 when default schema for the user is different to public on postgreSQL 11 Need to change the check of table "version" to specify the db user schema SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id] |
Hello everybody, is there any news about the topic yet? We would like to roll out gitea in our company and don't want to start a separate postgres database for each instance just because the schema can't be changed. Volker |
Yes it helps, but only for the installation process. After the installation is in some sql queries the schema hardcoded to public. See @Rizzen59 post. I issue is also present in version 1.9.4.
|
Well, that's good to know. The current PR that attempted to solve this was trying the hard way by modifying all queries, when in fact it could be easier.
it looks like this would be solved, but I'm no PostgreSQL expert. |
@lunny The solution is much much simpler 😁. I've just tested it locally. The problem is that xorm is forcing the What I did:
IMHO #3348 is trying to change all queries unnecessarily, and
If you agree with my analysis, I could pass a PR to xorm for the first two. |
@guillep2k Good catch! And if you can add a new database test with non-public schema of postgres, that's better. :) |
To be rigurous, xorm could run and parse a |
Hello, I used the container image 1.11.4. The following configuration of the database section is used. [database]
DB_TYPE = postgres
HOST = postgres:5432
NAME = postgres
SCHEMA = gitea
USER = gitea
PASSWD = <replaced>
SSL_MODE = disable
CHARSET = utf8 I receive the following log messaged dunring the startup. 2020/04/16 18:49:28 routers/init.go:66:initDBEngine() [I] ORM engine initialization attempt #6/10...
2020/04/16 18:49:28 ...rm.io/xorm/engine.go:351:Ping() [I] PING DATABASE postgres
2020/04/16 18:49:28 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 []interface {}{"public", "version"} - took: 13.683319ms
2020/04/16 18:49:28 .../xorm/session_raw.go:196:exec() [I] [SQL] CREATE TABLE IF NOT EXISTS "version" ("id" BIGSERIAL PRIMARY KEY NOT NULL, "version" BIGINT NULL) - took: 1.731081ms
2020/04/16 18:49:28 .../dialect_postgres.go:942:IsColumnExist() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id]
2020/04/16 18:49:28 .../xorm/session_raw.go:196:exec() [I] [SQL] ALTER TABLE "version" ADD "id" BIGSERIAL PRIMARY KEY NOT NULL ; - took: 7.201686ms
2020/04/16 18:49:28 routers/init.go:72:initDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: migrate: sync: pq: column "id" of relation "version" already exists
2020/04/16 18:49:28 routers/init.go:73:initDBEngine() [I] Backing off for 3 seconds I hope anyone can fix the issue and you cloud implement a test in the future so this won't happen again. Many greetings and stay healthy |
Database schema for postgres will be supported it |
Ohhh, thanks a lot for this information. Thanks 😃 |
[x]
):Hello, I have multiple instances for gitea. Every installation should use one big postgres database with his own schema.
So I create for one instance his own schema and username and changed the search_path to disable querying statements to the public schema, because I don't want, that any application or instance create his schema into public.
Here my psql statements
After installation gitea does not start and I get in my logs every time the same error.
Gitea look in the public schema? I have installed the instance into his own schema! How can I change in my docker-compose or app.ini the schema name?
Volker
The text was updated successfully, but these errors were encountered: