OSDN Git Service

Make handling of INTERVAL DAY TO MINUTE and INTERVAL DAY TO SECOND input
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Jun 2009 05:05:03 +0000 (05:05 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Jun 2009 05:05:03 +0000 (05:05 +0000)
commit5cca35a68b63c00d6a7b5d68868f809163929087
treef9d20e07132edd8e9b3ae650e15da2444a07f03d
parent0dcc73fea4a3371272465f418d323dbd45f9faff
Make handling of INTERVAL DAY TO MINUTE and INTERVAL DAY TO SECOND input
more consistent with other cases, by having an unlabeled integer field
be treated as a number of minutes or seconds respectively.  These cases
are outside the spec (which insists on full "dd hh:mm" or "dd hh:mm:ss"
input respectively), so it's not much help to us in deciding what to do.
But with this change, it's uniformly the case that an unlabeled integer
will be considered as being a number of the interval's rightmost field.
The change also takes us back to the 8.3 behavior of throwing error
for certain ambiguous inputs such as INTERVAL '1 2' DAY TO MINUTE.
Per recent discussion.
src/backend/utils/adt/datetime.c
src/test/regress/expected/interval.out