This is a summary of the text delimited by triple backticks:
PostgreSQL's interval apparatus, inherited by YSQL, is surprisingly large and complex due to historical facts and unfortunate design choices made by PostgreSQL implementers. The complexity arises from allowing hybrid interval values, which can lead to unpredictable results. However, with user-defined utilities that enforce safety, it is possible to avoid going wrong when working with intervals in YSQL. YugabyteDB's YSQL subsystem uses PostgreSQL's SQL processing C code as-is, resulting in consistent behavior between the two systems. By downloading and installing the companion code kit for the YSQL date-time documentation, users can access a range of code examples and tests that demonstrate the functionality and limitations of PostgreSQL's interval apparatus. The custom domain types feature allows users to create their own safe interval domains with specific semantics, providing a way to work around the limitations of the native interval apparatus.