-
- Downloads
Make extract() do something more reasonable with infinite datetimes.
Historically, extract() just returned zero for any case involving an infinite timestamp[tz] input; even cases in which the unit name was invalid. This is not very sensible. Instead, return infinity or -infinity as appropriate when the requested field is one that is monotonically increasing (e.g, year, epoch), or NULL when it is not (e.g., day, hour). Also, throw the expected errors for bad unit names. BACKWARDS INCOMPATIBLE CHANGE Vitaly Burovoy, reviewed by Vik Fearing
Showing
- doc/src/sgml/func.sgml 11 additions, 0 deletionsdoc/src/sgml/func.sgml
- src/backend/utils/adt/timestamp.c 99 additions, 12 deletionssrc/backend/utils/adt/timestamp.c
- src/test/regress/expected/date.out 242 additions, 0 deletionssrc/test/regress/expected/date.out
- src/test/regress/sql/date.sql 53 additions, 0 deletionssrc/test/regress/sql/date.sql
Loading
Please register or sign in to comment