On 30/04/2019 16:00, Andrew Gierth wrote:
"Adrian" == Adrian Klaver <adrian.kla...@aklaver.com> writes:

  Adrian> Or cast to a date:

  Adrian> test=> select date_trunc('day', localtimestamp)::date + 7;

yeesh. that's a very long-winded way to write current_date + 7

Well, current_date is different: current_date returns a date, so you only have to do:

   select current_date + 7;

The original question (if I remember correctly; have zapped it now) was about adding an integer to a timestamp, hence the need to truncate it to a date first as in Adrian's example above.

Ray.

--
Raymond O'Donnell // Galway // Ireland
r...@rodonnell.ie


Reply via email to