Create crosstype comparison operators for date vs. timestamp and date
Tom Lane <tgl@sss.pgh.pa.us>
Create crosstype comparison operators for date vs. timestamp and date vs. timestamptz. This allows use of indexes for expressions like datecol >= date 'today' - interval '1 month' which were formerly not indexable without casting the righthand side down from timestamp to date.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/date.c | modified | +417 −68 |
| src/backend/utils/adt/timestamp.c | modified | +10 −10 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_amop.h | modified | +25 −1 |
| src/include/catalog/pg_amproc.h | modified | +5 −1 |
| src/include/catalog/pg_operator.h | modified | +34 −5 |
| src/include/catalog/pg_proc.h | modified | +68 −7 |
| src/include/utils/date.h | modified | +31 −1 |
| src/include/utils/timestamp.h | modified | +9 −5 |