pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: the6campbells <the6campbells@gmail.com>
To: pgsql-sql@postgresql.org
Subject: date + interval year - why is the return type convered to a timestamp?
Date: Thu, 22 Oct 2009 17:04:50 -0400
Message-ID: <22431f1b0910221404i52040b19s7c89f6dda4ae187d@mail.gmail.com> (raw)

Why is Postgres returning a timestamp instead of the expected date data type
for the first expression (the second returns a date)?

In other words, is this a known bug or is it design intent. The manuals did
not seem to appear to say this is intentional behaviour but is not SQL
standard.

select date '2001-03-30' - interval '1' year, date '2001-03-30' - integer
'365' from tversion

view thread (2+ messages)  latest in thread

Message-ID: <22431f1b0910221404i52040b19s7c89f6dda4ae187d@mail.gmail.com>
Permalink:  ../22431f1b0910221404i52040b19s7c89f6dda4ae187d@mail.gmail.com/
Also on:    postgresql.org/message-id/22431f1b0910221404i52040b19s7c89f6dda4ae187d@mail.gmail.com

 · 

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: the6campbells@gmail.com
  Subject: Re: date + interval year - why is the return type convered to a timestamp?
  In-Reply-To: <22431f1b0910221404i52040b19s7c89f6dda4ae187d@mail.gmail.com>

* 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