date - date returns integer? - Mailing list pgsql-sql

From Andrew Hammond
Subject date - date returns integer?
Date
Msg-id 4228CC16.7020900@ca.afilias.info
Whole thread Raw
Responses Re: date - date returns integer?
Re: date - date returns integer?
List pgsql-sql
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Should date - date return type integer, not interval?

/* ahammond@test:5432/test =# */ SELECT ('2005-03-04'::timestamp -
'2005-01-01'::date)::interval;
~ interval
- ----------
~ 62 days
(1 row)

/* ahammond@test:5432/test =# */ SELECT ('2005-03-04'::date -
'2005-01-01'::date)::interval;
ERROR:  cannot cast type integer to interval

- --
Andrew Hammond    416-673-4138    ahammond@ca.afilias.info
Database Administrator, Afilias Canada Corp.
CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCKMwVgfzn5SevSpoRAlxAAJ9iPVf2yTNt11JBGc6Hun2s23+/MwCfYRwL
SzElfOrlIskOTAZucUdCeUE=
=jgOp
-----END PGP SIGNATURE-----


pgsql-sql by date:

Previous
From: Ken Johanson
Date:
Subject: Re: definative way to place secs from epoc into timestamp
Next
From: Bruno Wolff III
Date:
Subject: Re: date - date returns integer?