Re: Interval FAQ - please review - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Interval FAQ - please review
Date
Msg-id web-103582@davinci.ethosmedia.com
Whole thread Raw
In response to Re: Interval FAQ - please review  ("Jeff Eckermann" <jeckermann@verio.net>)
List 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
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Vivek Khera
Date:
Subject: Re: Re: Interval FAQ - please review
Next
From: "Josh Berkus"
Date:
Subject: Re: Re: Interval FAQ - please review