Re: EXTRACT broken

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXTRACT broken
Date: 2001-10-12 05:37:52
Message-ID: 3BC681B0.C404E845@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-10-12 06:07:08 Re: Unicode combining characters
Previous Message Bruce Momjian 2001-10-12 05:33:50 Re: Glitch in handling of postmaster -o options