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

Suggestion for Date/Time Functions Section

From: CSN <cool_screen_name90001(at)yahoo(dot)com>
To: pgsql-docs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Suggestion for Date/Time Functions Section
Date: 2005-08-20 04:59:21
Message-ID: 20050820045921.40396.qmail@web52914.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-docspgsql-general
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);
date '2001-09-28' + ((7+7)||' seconds')::interval);
etc.

Or am I missing an easier way to do date arithmetic
using a table's fields as part of the equation? (I
think mysql has date_add(...), date_subtract(...),
etc.

CSN

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Responses

pgsql-docs by date

Next:From: Michael GlaesemannDate: 2005-08-20 05:42:48
Subject: Re: Suggestion for Date/Time Functions Section
Previous:From: Jim C. NasbyDate: 2005-08-17 22:42:42
Subject: Search bug

pgsql-general by date

Next:From: A. KretschmerDate: 2005-08-20 05:39:14
Subject: Re: Postgresql Function Language question
Previous:From: Alvaro HerreraDate: 2005-08-20 03:29:32
Subject: Re: <IDLE> in transaction

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