There are several different ways to approach fuzzy dates. In PostgreSQL you can use
- a couple of date columns (early_user_building, last_data_ landing),
- date column and precision column ('2012-01-01', 'year') or
- a data type of a range range (daterange) or
- a varchar ('2013-01-2?', '2013 - ?? - 05') or
- another table or tables with any of these data types.
The range data type is common to the latest versions of PostgreSQL. You can use the rest in any SQL files.
The type of fuzziness you need depends on the application. How you request fuzzy dates depends on what type or structure of data you choose. You need to firmly understand what types of fuzziness you need to store, and the questions that your users need. And you need to check so that your database can answer their questions.
For example, in legal systems, dates may be poorly stored or damaged. Someone might say: βIt was some Thursday in January 2014. I know that it was Thursday because it was a day of garbage collection,β or βIt was the first week in June or July of last year.β To record this fuzziness, you need another table.
Or the postmark may be clouded so that you can only read "14, 2014". You know that it was mailed on the 14th, but you donβt know what month. Again, you need another table.
Some (all?) Of them will not give you three-valued logic if you do not jump over some hoops. ("Maybe" is not a valid boolean value.)
source share