Skip to content
Snippets Groups Projects
  • Tom Lane's avatar
    7a52a8f8
    Clean up the code for to_timestamp's conversion of year plus ISO day number · 7a52a8f8
    Tom Lane authored
    to date, as per bug #4702 and subsequent discussion.  In particular, make it
    work for years specified using AD/BC or CC fields, and fix the test for "no
    year specified" so that it doesn't trigger inappropriately for 1 BC (which it
    was doing even in code paths that had nothing to do with to_timestamp).  I
    also did some minor code beautification in the non-ISO-day-number code path.
    
    This area has been busted all along, but because the code has been rewritten
    repeatedly, it would be considerable trouble to back-patch.  It's such a
    corner case that it doesn't seem worth the effort.
    7a52a8f8
    History
    Clean up the code for to_timestamp's conversion of year plus ISO day number
    Tom Lane authored
    to date, as per bug #4702 and subsequent discussion.  In particular, make it
    work for years specified using AD/BC or CC fields, and fix the test for "no
    year specified" so that it doesn't trigger inappropriately for 1 BC (which it
    was doing even in code paths that had nothing to do with to_timestamp).  I
    also did some minor code beautification in the non-ISO-day-number code path.
    
    This area has been busted all along, but because the code has been rewritten
    repeatedly, it would be considerable trouble to back-patch.  It's such a
    corner case that it doesn't seem worth the effort.