Good day, community! There is a view database that takes data depending on the ranges. The problem is that fields with different types are compared (timestamp, date, timestamptz). I use tsrange () and change the type inside it (:: timestamp). A change of type occurs, but something translates into a timestamp, something in a timestamptz, why I don’t know why. How to beat it and bring everything to a timestamp? Or what method to use for universal comparison of these types? (I cannot change field types in tables).
My example:
tsrange(t1.start_date,t1.end_date) @> tsrange(coalesce(docPos.start_date::timestamp,dStartDate::timestamp),coalesce(docPos.end_date::timestamp,dEndDate::timestamp)); If you throw links, please indicate what you should pay attention to. Thanks for answers.