Re: [GENERAL] Interval Question

2005-01-12 Thread Terry Lee Tucker
We, that is, Geoffrey, applied the patch and rebuilt the rpm's. I have installed the new rpm and the problem is resolved. We are in the process of converting a transportation package from a commercial database product to Postgres. On at least two occassions, I have reported bugs to that software

Re: [GENERAL] Interval Question

2005-01-12 Thread Marco Colombo
On Tue, 11 Jan 2005, Geoffrey wrote: Tom Lane wrote: Terry Lee Tucker <[EMAIL PROTECTED]> writes: Apparently, if DateStyle is set to Sql, it always returns the absolute value. Is this due to some Sql standard or is it a bug? It's a bug in interval_out. Looks like it gets it wrong for GERMAN styl

Re: [GENERAL] Interval Question

2005-01-11 Thread Tom Lane
Geoffrey <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> It's a bug in interval_out. Looks like it gets it wrong for GERMAN >> style too. Surprising no one noticed before. > Any idea when I might be able to put my hands on Red Hat 3 rpm versions > that include this fix? [ shrug... ] Whenever

Re: [GENERAL] Interval Question

2005-01-11 Thread Geoffrey
Tom Lane wrote: Terry Lee Tucker <[EMAIL PROTECTED]> writes: Apparently, if DateStyle is set to Sql, it always returns the absolute value. Is this due to some Sql standard or is it a bug? It's a bug in interval_out. Looks like it gets it wrong for GERMAN style too. Surprising no one noticed befo

Re: [GENERAL] Interval Question

2005-01-11 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > Apparently, if DateStyle is set to Sql, it always returns the absolute value. > Is this due to some Sql standard or is it a bug? It's a bug in interval_out. Looks like it gets it wrong for GERMAN style too. Surprising no one noticed before. (In any

Re: [GENERAL] Interval Question

2005-01-11 Thread Terry Lee Tucker
Thanks for the answers. By the way, I'm not trying to parse the textual output to discover if it is netative. Apparently, I failed to communicate my purpose properly. I just want to return the value, regardless of netative or positive, to the user and store it in a column of type interval. I si

Re: [GENERAL] Interval Question

2005-01-11 Thread Terry Lee Tucker
Apparently, if DateStyle is set to Sql, it always returns the absolute value. Is this due to some Sql standard or is it a bug? On Tuesday 11 January 2005 10:19 am, Tom Lane saith: > Terry Lee Tucker <[EMAIL PROTECTED]> writes: > > I thought that subtracting the larger interval from > > the small

Re: [GENERAL] Interval Question

2005-01-11 Thread Terry Lee Tucker
Check this out: rnd=# show DateStyle; DateStyle --- SQL, MDY (1 row) rnd=# select interval '@ 3 days 4 hours 17 mins'::interval - '@ 3 days 6 hours 17 mins'::interval; ?column? --- @ 2 hours (1 row) And... rnd=# set DateStyle to postgres; SET rnd=# select interval '@ 3 days 4

Re: [GENERAL] Interval Question

2005-01-11 Thread Terry Lee Tucker
Is is a "bare bones" copy of the function. The travel time is hard coded for the example. By the way, I'm on version 7.4. On Tuesday 11 January 2005 10:10 am, Timothy Perrigo saith: > Can you post the code for the function you are having trouble with? > The following psql query works as expected

Re: [GENERAL] Interval Question

2005-01-11 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > I thought that subtracting the larger interval from > the small would return this but it is always the absolute value. Eh? regression=# set DateStyle TO ISO; SET regression=# select '@ 3 days 4 hours 17 mins'::interval - regression-# '@ 3 days 6 hou

Re: [GENERAL] Interval Question

2005-01-11 Thread Stephan Szabo
On Tue, 11 Jan 2005, Terry Lee Tucker wrote: > As you can see, this truck is going to be 2 hours late. The return value I'm > looking for is the difference between Appt. Interval and Travel Interval, as > in: return (appt_interval - travel_interval). This value will be stored in a > column of ty

Re: [GENERAL] Interval Question

2005-01-11 Thread Timothy Perrigo
Can you post the code for the function you are having trouble with? The following psql query works as expected (returns a negative interval): select '3 days 4 hours 17 mins'::interval - '3 days 6 hours 17 mins'::interval; ?column? --- -02:00:00 Inserting the difference into a table

Re: [GENERAL] interval question

2001-03-06 Thread dev
On 3/6/01, 12:59:40 AM, Fernando "P." Schapachnik <[EMAIL PROTECTED]> wrote regarding [GENERAL] interval question: > Hello: > Maybe somebody on the list can give me a hand with this. I > have: > id serial, > start time, > duration time Surely "duration" should be of type interval. Also -