Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 71953633371 for ; Thu, 22 Oct 2009 18:05:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 33291-06 for ; Thu, 22 Oct 2009 21:04:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mail.postgresql.org (Postfix) with ESMTP id 44D9F632176 for ; Thu, 22 Oct 2009 18:04:53 -0300 (ADT) Received: by fxm6 with SMTP id 6so9534427fxm.19 for ; Thu, 22 Oct 2009 14:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=8ZHr8uA1+0As8FxbPfP2z/olIPJJ5BTPk9wQAvwkLpQ=; b=QWZS6pkUqDv5j4qcUaGjpctm+9MK5x8lUhUyeReEFpzi7gc+tYCa3F/mLjrj7/xypu RzJpGnpymNEsjMvoMewwQbNgDsoKh039fBE3yBT6P6HYOpCQmNt7g8No4hj/uE/zs828 t9zyaMVw6mPkSNcDWQCT/Y9rCaWG2jct1c7yI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=KzGpvhMOEybVZcHPuGZ45MIZFaQ4MoUhEYNplj+KBuIQtaSvZBPweA4b8+WZRvdm+U mvaC+xfPFXOrpCOSPgZX9h8E235MU4Ft2U52JE+oxIZDGUvSLWaBja5SlIkFJigVPy6v TFuCLtNfti2NM61VM73F9oK1duV+gkfZhtBj4= MIME-Version: 1.0 Received: by 10.204.32.79 with SMTP id b15mr10206125bkd.47.1256245490804; Thu, 22 Oct 2009 14:04:50 -0700 (PDT) Date: Thu, 22 Oct 2009 17:04:50 -0400 Message-ID: <22431f1b0910221404i52040b19s7c89f6dda4ae187d@mail.gmail.com> Subject: date + interval year - why is the return type convered to a timestamp? From: the6campbells To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=00032556054a3ae9f604768c7232 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.04 tagged_above=-10 required=5 tests=AWL=0.558, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200910/114 X-Sequence-Number: 33313 --00032556054a3ae9f604768c7232 Content-Type: text/plain; charset=ISO-8859-1 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 --00032556054a3ae9f604768c7232 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Why is Postgres returning a timestamp instead of the expected date dat= a type for the first expression (the second returns a date)?=A0
<= br>
In other words, is this a known bug or is it design intent. T= he 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 &#= 39;365' from tversion



--00032556054a3ae9f604768c7232--