Re: Interval FAQ - please review

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: "Jeff Eckermann" <jeckermann(at)verio(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Interval FAQ - please review
Date: 2001-08-16 20:42:06
Message-ID: web-103582@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jeff,

> Why not just include examples of DATEDIFF and DATEADD functions?
> For example:
> CREATE FUNCTION datediff(timestamp, timestamp)
> RETURNS integer AS '
> BEGIN
> RETURN $2 - $1;
> END;
> ' LANGUAGE 'plpgsql';

Not a bad idea. Unfortunately, DATEDIFF & DATEADD are more complicated
than that. More importantly, I don't want to get into Function design
in this article, which is aimed at newbies.

If, however, anyone *does* have an online sample of one or both of these
two functions, I'd love to link to it from the article.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-08-16 20:44:37 Re: Re: Interval FAQ - please review
Previous Message Mark Stosberg 2001-08-16 20:34:41 Re: Re: Help!!! Trying to "SELECT" and get a tree structure back.