Re: EXTRACT broken - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: EXTRACT broken
Date
Msg-id 3BC681B0.C404E845@fourpalms.org
Whole thread Raw
In response to Re: EXTRACT broken  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: EXTRACT broken
List pgsql-hackers
> > > peter=# SELECT EXTRACT(DOW FROM TIME '20:38:40');
> > > ERROR:  Interval units 'dow' not recognized
> > > The expression is nonsensical, but so is the result.
> > Hmm. Why is the result nonsensical? "day of week" does not have meaning
> > for intervals, so it should not be recognized, right?
> It's the "interval" part that's troubling me, since it appears nowhere in
> the original expression.

Oh yeah. We don't have a date_part(units, time) function defined, so it
is getting converted to interval (which in other contexts *does* have
some usefulness as a "time equivalent").

We could fairly easily define a date_part() for the time and timetz data
types.
                     - Thomas


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Unicode combining characters
Next
From: Bruce Momjian
Date:
Subject: Re: Glitch in handling of postmaster -o options