2 ms·
Dates are natural keys. You seem to be conflating format and value. 1,234,567 and 1234567 are the same number. 19-Jun-21 and 2021-06-19 are the same date. D
by mulmen 5y ago
Dates are natural keys.
You seem to be conflating format and value. 1,234,567 and 1234567 are the same number. 19-Jun-21 and 2021-06-19 are the same date. Databases already handle this.
- jameshart 5y ago19 June 2021 is also known as: Dhuʻl-Qiʻdah 9, 1442 AH 9 Tamuz 5781
- mulmen 5y agoGreat! Then if they are unambiguous they can be inserted directly or disambiguated and then inserted. At query time any format can be used to represent them to a user.
- jameshart 5y agoAh, so you're suggesting instead of storing 'what a person calls this date' as the key, you instead convert it to some underlying representation that you can then choose to present in different calendars - like a UNIX epoch-relative offset or something. Congratulations, you just created another synthetic key for describing dates.
- deleted 5y ago[deleted]
- mulmen 5y agoThe date is a natural key. The format string is only a representation. Implementation details are irrelevant to the definition of a natural key.
- goto11 5y agoThat is not what synthetic key means. A synthetic key is a key which does not carry any information, like an auto-incremented integer. A date is a natural key, regardless of the underlying representation.