Reintroduce postgres support
In Short
- [x] Updates all places where postgres queries were out of sync with other databases
- [x] Introduces new postgres queries in places where they weren’t supported before
- [x] Updates all table creation logic for postgres
- [x] Introduces rudimentary support for postgres in tests
- [x] Updates all
REPLACE INTOstatements to support postgres properly as well - [x] Updates the new database backend to support postgres
- [x] Implements the new query logic for postgres
- [x] Validate and test the changes
- [x] Ensure postgres support in Seahub and Seafdav as well
- [x] Ensure users upgrading from older versions are supported as well
Related
https://github.com/haiwen/seafdav/pull/66 https://github.com/haiwen/seahub/pull/5196
Rationale
Many users (me included) use Seafile with PostgreSQL databases. Seafile has supported Postgres databases with small patches for many years, but during a recent db backend rewrite that functionality got removed. My own deployment has been stuck on 7.0, with no update in sight.
Due to that, I’ve decided to implement Postgres support back into Seafile. If it doesn’t get merged, I’ll have to maintain a custom fork with downstream patches, which I’d like to avoid.
@haiwen I’d like to request a review for this PR and the related PRs. If you’d find time to take a look at these, that’d be great!
I know that even with these patches the PE won’t support postgres, but it’d be great to have at least postgres support in the CE.