Re: timestamp - timestamp result

2020-06-26 Thread Tom Lane
Pavel Stehule writes: > pá 26. 6. 2020 v 7:29 odesílatel Thomas Kellerer napsal: >> Is it safe to assume that "timestamp - timestamp" will never contain units >> larger then days? > Now, this operator internally calls only interval_justify_hours functions. We should probably document that --- I

Re: timestamp - timestamp result

2020-06-25 Thread Pavel Stehule
pá 26. 6. 2020 v 7:29 odesílatel Thomas Kellerer napsal: > I regularly see people suggesting to use > > extract(day from one_timestamp - other_timestamp) > > to calculate the difference between two timestamps in days. > > But I wonder if the "format" of the resulting interval is guaranteed to

timestamp - timestamp result

2020-06-25 Thread Thomas Kellerer
I regularly see people suggesting to use extract(day from one_timestamp - other_timestamp) to calculate the difference between two timestamps in days. But I wonder if the "format" of the resulting interval is guaranteed to only have days (and not months or years) The following: times