[SQL] date - date returns integer?

2005-03-04 Thread Andrew Hammond
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Should date - date return type integer, not interval? /* [EMAIL PROTECTED]:5432/test =# */ SELECT ('2005-03-04'::timestamp - '2005-01-01'::date)::interval; ~ interval - -- ~ 62 days (1 row) /* [EMAIL PROTECTED]:5432/test =# */ SELECT

Re: [SQL] date - date returns integer?

2005-03-04 Thread Bruno Wolff III
On Fri, Mar 04, 2005 at 15:59:02 -0500, Andrew Hammond [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Should date - date return type integer, not interval? Yes. This is in the documentation. ---(end of broadcast)---

Re: [SQL] date - date returns integer?

2005-03-04 Thread Tom Lane
Andrew Hammond [EMAIL PROTECTED] writes: Should date - date return type integer, not interval? If we made it return interval then there would be all sorts of timezone dependencies introduced (think about DST crossings) ... which is generally something you don't want to think about when doing