A solution for this problem heavy relies on the fact that you can guarantee your dates are starting after a certain year for which the two numbers representation doesn't overlap with the years passed in 2000 century so far.
E.g. if the earliest datapoint is in 1930 you'll know that anything with YY less than 30 needs to be considered 2000+ and anything >30 needs to be considered 1900-1999. If you have entries also for years like 1919 the above problem is not solvable because any date with YY=[00-21] can't be uniquely associated.
However, if you can state that your dates can't be bigger than today's date then a possible solution is to check if the extracted date is bigger than today, if so, add a '19` prefix to the year, like in the example below
with dt as (
select '0303653597' dt_str
union all
select '1705213597' dt_str
union all
select '1805213597' dt_str
)
select
to_date(
substring(dt_str from 0 for 5) ||
case when
to_date(substring(dt_str from 0 for 7),'DDMMYY' ) <= current_date
then '20'
else '19'
end
|| substring(dt_str from 5 for 2)
,'DDMMYY')
from dt;
For the 3 dates (03/03/65, 17/05/21 and 18/05/21) as of today (17/05/21) the output will correctly be
to_date
------------
1965-03-03
2021-05-17
1921-05-18
(3 rows)