Re: DATE type output does not follow datestyle parameter

Поиск
Список
Период
Сортировка
От MauMau
Тема Re: DATE type output does not follow datestyle parameter
Дата
Msg-id 8E0F3B2D0578401A804DAD513E93A1CE@maumau
обсуждение исходный текст
Ответ на Re: DATE type output does not follow datestyle parameter  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: DATE type output does not follow datestyle parameter  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
From: "Adrian Klaver" <adrian.klaver@gmail.com>
> Actually the relevant code seems to be here:
>
> /src/ backend/parser/gram.y
>
>
> CURRENT_DATE
>                                {
>                                        /*
>                                         * Translate as
> "'now'::text::date".
>                                         *
> ....
>
> CURRENT_TIMESTAMP
>                                {
>                                        /*
>                                         * Translate as "now()", since
> we have a function that
>                                         * does exactly what is needed.
> ...
>
>
> Also from :
>
> 8.5.1.4. Special Values
>
> The following SQL-compatible functions can also be used to obtain the
> current time value for the corresponding data type: CURRENT_DATE,
> CURRENT_TIME, CURRENT_TIMESTAMP, LOCALTIME, LOCALTIMESTAMP. The latter
> four accept an optional subsecond precision specification. (See Section
> 9.9.4.) Note that these are SQL functions and are not recognized in data
> input strings.
>
>
>
> It would seem the functions are special cased.


As below, normal DATE constants also does not follow the setting of
datestyle.  Is this a bug?

SET datestyle = 'Postgres, MDY';
SELECT DATE 'Jan 2 2013';
    date
------------
 01-02-2013
(1 row)

Regards
MauMau



В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: How to do incremental / differential backup every hour in Postgres 9.1?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: how _not_ to log?