mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 09:46:00 +03:00
[GH-ISSUE #1189] PostgreSQL backend doesn't use the "uuid" type #836
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#836
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pounard on GitHub (Oct 16, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1189
Hello, I noticed that PostgreSQL schema doesn't use the
uuidtype for UUIDs, is there a reason for this ?@BlackDex commented on GitHub (Oct 16, 2020):
I actually have no idea.
I do see we use varchar and char for uuid's.
I don't know if there is a specific reason for not using uuid.
@dani-garcia commented on GitHub (Oct 17, 2020):
I think it's done that way to keep consistency with SQLite, which doesn't have a specific uuid type.
@pounard commented on GitHub (Oct 19, 2020):
For scaling, UUID performance on PostgreSQL is much better than using VARCHAR (CPU and as well memory consumption) - just highlighting this. I regularly do web applications that uses them, there is no consequence in using a VARCHAR on sqlite side and the real UUID type on the pgsql type besides the fact that pgsql will validate them on UPDATE/INSERT operations (with a new error case you must handle in business code, of course). But using a good uuid library, such a validation errors actually never happened to me.
@BlackDex commented on GitHub (Jan 31, 2021):
I'm not sure what to do with this ticket. Do we want to leave it as-is so that we keep a more uniform format in code, or do we want to change this to increase performance and scaling?
I am kinda in favor of keeping it as-is. Also because the main developers/contributors do not use Postgresql them self's as far as i know.
@dani-garcia, what do you think?
@pounard commented on GitHub (Feb 1, 2021):
@BlackDex I have no strong feeling, I originally created purely for informational purpose.
@dani-garcia commented on GitHub (Feb 3, 2021):
If I had to do it all again I'd go with UUIDs too, but seeing as we use uuids everywhere I'd rather keep it as it is now, just to avoid the big migrations we'd have to do to swap them. If the performance ever gets noticeably bad, we can always revisit this decision.