Postgres: must be owner of table session during ensure up to date

Hi,

I’m using Postgres with Gitea and have two DB credentials:

  1. “gitea_admin” - All privileges except superuser
  2. “gitea_user” - All privileges except superuser and create databases

All tables have owner set to “gitea_admin”

During migration and upgrades, I use the “gitea_admin” credentials in Gitea’s app.ini. This works fine and has allowed me to migrate from a v1.12 to v.1.21 without issue.

For normal operation, I normally use the “gitea_user” credentials. Since v1.14, I receive the error “pq: must be owner of table session during ensure up to date” and Gitea fails to run.

I believe it’s part of the migration preflight run at startup. The database is already upgraded to the correct version, so does Gitea really require the table owner credentials for day to day operations?

Thanks in advance!

I don’t think it technically requires table owner permissions, but I’m not sure what your setup accomplishes with having both gitea_admin and gitea_user. For me, I have superuser account and gitea account with no special privileges. I used superuser account to create gitea database and assign gitea as database owner, and then ran Gitea installation. All migrations/normal operations run as gitea user.