pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Hammond <ahammond@ca.afilias.info>
To: pgsql-sql@postgresql.org
Subject: date - date returns integer?
Date: Fri, 04 Mar 2005 15:59:02 -0500
Message-ID: <4228CC16.7020900@ca.afilias.info> (raw)

-----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-----



view thread (3+ messages)  latest in thread

Message-ID: <4228CC16.7020900@ca.afilias.info>
Permalink:  ../4228CC16.7020900@ca.afilias.info/
Also on:    postgresql.org/message-id/4228CC16.7020900@ca.afilias.info

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ahammond@ca.afilias.info
  Subject: Re: date - date returns integer?
  In-Reply-To: <4228CC16.7020900@ca.afilias.info>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox