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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-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

Browse pgsql-docs by date

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

Browse pgsql-general by date

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