In order to find a solution I see some possible ways. Please feel free to add more ideas.
1. We restructure our system and split year, month, day for every date as separate infos (int resp. smallint).
year INTEGER NOT NULL,
month SMALLINT CHECK (month BETWEEN 1 AND 12),
day SMALLINT CHECK (day BETWEEN 1 AND 31)
This allows for sorting, calculating etc. if we want be more detailed we could also add hours, mins, secs.
In the documentation we should also note that dates before 1582 are julian calendar and before -4713 are solar years
2. We leave everything as is and just add another field
yearbefore4713 INTEGER NOT NULL,
if a year before 4713bc is entered the value is saved here.
UI resp. backend however must handle checks and validation and not allow days or any other smaller units for dates before -4713 and save the value in the respective field
Also in the manual we should consider to document that every date before this is meant as solar year
For sorting these dates in bITEM or THANADOS I implemented functions that calculate days before present on the fly