Which table does gitea store its users when using postgres? #2023

Closed
opened 2025-11-02 04:21:30 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @savyajha on GitHub (Jul 7, 2018).

  • Gitea version (or commit ref): 1.4.3
  • Git version: 2.18.0
  • Operating system: Arch Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I'd like to know which table gitea stores its users in. I've been trying to migrate from mysql to postgres, but for the life of me I don't understand where gitea stores its users. To check where it stores users, I launched two different instances of gitea, with one using mysql and the other using postgresql. I then added a user during installation for both. I checked the user table in both mysql and postgres. The mysql one is populated as I expect it to, but I don't see the postgres user table being populated when I add a new user.

This is quite vexing, because my production instance has all its users in the user table in mysql which I cannot migrate over: I don't know where users get stored in postgres. Every other table is migrating over perfectly fine.

Originally created by @savyajha on GitHub (Jul 7, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) 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.4.3 - Git version: 2.18.0 - Operating system: Arch Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description I'd like to know which table gitea stores its users in. I've been trying to migrate from mysql to postgres, but for the life of me I don't understand where gitea stores its users. To check where it stores users, I launched two different instances of gitea, with one using mysql and the other using postgresql. I then added a user during installation for both. I checked the `user` table in both mysql and postgres. The mysql one is populated as I expect it to, but I don't see the postgres `user` table being populated when I add a new user. This is quite vexing, because my production instance has all its users in the `user` table in mysql which I cannot migrate over: I don't know where users get stored in postgres. Every other table is migrating over perfectly fine.
GiteaMirror added the type/question label 2025-11-02 04:21:30 -06:00
Author
Owner

@gsantner commented on GitHub (Jul 7, 2018):

maybe do a fresh install and and just purge db after install (e.g. in VM/docker)? this probably will answer all other questions like "where is X stored"

@gsantner commented on GitHub (Jul 7, 2018): maybe do a fresh install and and just purge db after install (e.g. in VM/docker)? this probably will answer all other questions like "where is X stored"
Author
Owner

@savyajha commented on GitHub (Jul 7, 2018):

I found it, sorry, I overlooked something silly. Now the only problem is that it tells me my password is wrong. :/

@savyajha commented on GitHub (Jul 7, 2018): I found it, sorry, I overlooked something silly. Now the only problem is that it tells me my password is wrong. :/
Author
Owner

@techknowlogick commented on GitHub (Jul 7, 2018):

@savyajha you can reset password via command line: https://docs.gitea.io/en-us/command-line/

I'm going to close this ticket now as you've discovered the table.

@techknowlogick commented on GitHub (Jul 7, 2018): @savyajha you can reset password via command line: https://docs.gitea.io/en-us/command-line/ I'm going to close this ticket now as you've discovered the table.
Author
Owner

@Freccia commented on GitHub (Jul 8, 2018):

Hello,
I had the same issue (user table seems unpopulated), which is more postgres related, but I solved by doing this:

$ sudo -u postgres psql
postgres=#  \c gitea
gitea=# SELECT * FROM public.user;
@Freccia commented on GitHub (Jul 8, 2018): Hello, I had the same issue (`user` table seems unpopulated), which is more `postgres` related, but I solved by doing this: ``` $ sudo -u postgres psql postgres=# \c gitea gitea=# SELECT * FROM public.user; ```
Author
Owner

@savyajha commented on GitHub (Jul 8, 2018):

Yeah, thanks. Another way is to quote "user". My problem is that the tool I used for import from mysql didn't associate the tables with the public schema, which meant that gitea couldn't really access them.

@savyajha commented on GitHub (Jul 8, 2018): Yeah, thanks. Another way is to quote `"user"`. My problem is that the tool I used for import from mysql didn't associate the tables with the public schema, which meant that gitea couldn't really access them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2023