Re: adding years to a date field - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: adding years to a date field
Date
Msg-id 6F852C30-7A85-4AF4-8BA3-A9596BCCB89F@seespotcode.net
Whole thread Raw
In response to Re: adding years to a date field  (Christine Penner <chris@fp2.ca>)
List pgsql-general
On Apr 6, 2011, at 12:18, Christine Penner wrote:

> This still gave me a sytax error. The other suggestion to multiply the interval field by 1 year also gave me a syntax
error.

What was the error? And it's preferable to do multiply rather than do the equivalent of an eval on some string.


select (current_timestamp at time zone 'utc' + CAST(3 AS SMALLINT) * interval '1 year');
          ?column?
----------------------------
 2014-04-06 16:27:30.273562
(1 row)

Michael Glaesemann
grzm seespotcode net




pgsql-general by date:

Previous
From: "Davenport, Julie"
Date:
Subject: Re: temp tables not dropping at end of script
Next
From: Christine Penner
Date:
Subject: Re: adding years to a date field