Re: BUG #7824: documentation bug: Extract DOW

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: BUG #7824: documentation bug: Extract DOW
Дата
Msg-id
20130910013828.GG32173@momjian.us
Ответ на
Список
Дерево обсуждения
BUG #7824: documentation bug: Extract DOW tim.romano@yahoo.com
Re: BUG #7824: documentation bug: Extract DOW Bruce Momjian <bruce@momjian.us>
Re: BUG #7824: documentation bug: Extract DOW Pavan Deolasee <pavan.deolasee@gmail.com>
On Tue, Jan 22, 2013 at 08:40:30PM +0000, tim.romano@yahoo.com wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      7824
> Logged by:          Tim Romano
> Email address:      tim.romano@yahoo.com
> PostgreSQL version: 9.2.2
> Operating system:   Windows 7 x64
> Description:        
> 
> Documentation seems to indicate that only a Timestamp value is a valid
> argument to the Extract function when trying to get the DOW, but a Date also
> works:
> 
> dow 
> The day of the week (0 - 6; Sunday is 0) (for timestamp values only)
> 
> SELECT EXTRACT(DOW FROM TIMESTAMP '2001-02-16 20:38:40'); Result: 5

[Sorry for the late reply.]

I assume you mean:

	SELECT EXTRACT(DOW FROM DATE '2001-02-16');
	 date_part
	-----------
	         5
	(1 row)

That does work fine, and is documented in PG 9.2:

	http://www.postgresql.org/docs/9.2/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
	The extract function retrieves subfields such as year or hour from
	date/time values. source must be a value expression of type timestamp,
-->	time, or interval. (Expressions of type date are cast to timestamp and
-->	can therefore be used as well.) 

Where did you see that DATE is not supported for EXTRACT?

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
В списке pgsql-bugs по дате отправления
От: Bruce Momjian
Дата:
От: Sbis-Partner
Дата:
Сообщение: Error by restore a database
FAQ