DIRACGrid / DIRACGrid/diracx

About using PostgreSQL instead of MySQL

Open
#378 4 comments 0 reactions 1 assignee Claimed by @AcquaDiGiorgio View on GitHub
Dominant language
Python
Stars
19
Forks
45
Avg merge
4d 23h
Merged PRs (30d)
12

Description

@AcquaDiGiorgio did a fantastic job at trying out postgreSQL in https://github.com/DIRACGrid/diracx/pull/297 and https://github.com/DIRACGrid/diracx-charts/pull/115

These PRs should still serve as a reference for later, but unfortunately it cannot be merged as it is now.
The problem is that PostgreSQL require timezone aware datetimes, while `MySQL` tolerates datetimes without a timezone. DIRAC had never set any timezone in its datetimes, so the content of the existing databases is "wrong".
Given that everybody will start `diracx` from existing DBs, we will live with timezone unaware DB until all the DBs are migrated to `diracx`. Only then can we update the DB, add the timezone, adapt the code on the `diracx` side to do the correct thing, and from then on PostgreSQL can be an option.

For reference, the main lesson learned from the PR:
* timezone problem
* `result.lastrowid` -> `result.inserted_primary_key[0]`

Thanks again @AcquaDiGiorgio for the great work !

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.