Re: [SQL] Re: Interval FAQ - please review

2001-08-16 Thread Josh Berkus
Vivek, > JB> Q. What about TIMESTAMP WITH TIME ZONE? > JB> A. An important topic, and datatype, that I don't want to get > into here. > JB> See the PostgreSQL docs. > > Those docs are lacking an explanation that there is no such thing in > PostgreSQL as a timestamp *without* time zone. Hmmm .

[SQL] Re: Interval FAQ - please review

2001-08-16 Thread Josh Berkus
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 th

Re: [SQL] Re: Interval FAQ - please review

2001-08-16 Thread Vivek Khera
> "JB" == Josh Berkus <[EMAIL PROTECTED]> writes: >> Those docs are lacking an explanation that there is no such thing in >> PostgreSQL as a timestamp *without* time zone. JB> Hmmm OK, I'll revise the A: but I *don't* want to go into Time Zone JB> issues in this intro. Any docs I can

[SQL] Re: Interval FAQ - please review

2001-08-16 Thread Jeff Eckermann
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'; And similarly with DATEADD. You will increase the scope (and length) of your article, but only slightly

[SQL] Re: Interval FAQ - please review

2001-08-16 Thread Vivek Khera
> "JB" == Josh Berkus <[EMAIL PROTECTED]> writes: JB> Q. What about TIMESTAMP WITH TIME ZONE? JB> A. An important topic, and datatype, that I don't want to get into here. JB> See the PostgreSQL docs. Those docs are lacking an explanation that there is no such thing in PostgreSQL as a time