Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Suggestion for Date/Time Functions Section

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-docs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Suggestion for Date/Time Functions Section
Date: 2005-08-20 05:44:30
Message-ID: 20050819224233.C81094@megazone.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-docspgsql-general
On Fri, 19 Aug 2005, CSN wrote:

> Hi,
>
> I suggestion for the date/time functions in the docs:
> http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html
>
> I was trying to figure out how to do:
> update table set next=now() + interval 'table.period
> seconds';
>
> I tried subqueries, the concat operator, and anything
> else I could think of until I rediscovered the page on
> the various ways to cast. Perhaps mix up the examples
> in the docs so other ways to do date arithmetic (and
> that allow expressions, fields, etc.) are obvious:
>
> date '2001-09-28' + cast((7+7)||' seconds' as
> interval);

I'd suggest something like
 date '2001-09-28' + (7+7) * interval '1 second';
instead of using text concatenation.


In response to

pgsql-docs by date

Next:From: Robert TreatDate: 2005-08-21 15:20:13
Subject: Re: Search bug
Previous:From: Michael GlaesemannDate: 2005-08-20 05:42:48
Subject: Re: Suggestion for Date/Time Functions Section

pgsql-general by date

Next:From: Tony CadutoDate: 2005-08-20 14:00:56
Subject: Re: Postgresql Function Language question
Previous:From: Michael GlaesemannDate: 2005-08-20 05:42:48
Subject: Re: Suggestion for Date/Time Functions Section

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group