Re: changing datestyle

Поиск
Список
Период
Сортировка
Искать
От
Karl Nack
Тема
Re: changing datestyle
Дата
Msg-id
alpine.DEB.1.10.0906161207510.20782@mindinao
Ответ на
Список
Дерево обсуждения
changing datestyle "Karl Nack" <karlnack@futurityinc.com>
Re: changing datestyle Tom Lane <tgl@sss.pgh.pa.us>
Re: changing datestyle Karl Nack <karlnack@futurityinc.com>
Re: changing datestyle Tom Lane <tgl@sss.pgh.pa.us>
Re: changing datestyle Karl Nack <karlnack@futurityinc.com>
Re: changing datestyle Tom Lane <tgl@sss.pgh.pa.us>
>> And yet datestyle continues to come back as 'ISO, MDY'.
>
> That's exactly what it should do.  'US' is a synonym for 'MDY',
> and in any case it determines only one of the two components
> of DateStyle.
>
> (The fact that there are two components is a historical aberration,
> and I'd be the first to agree it's ugly, but that's how it works.)

My understanding is that the first component indicates how dates are 
output by default, the second how dates are interpreted upon input 
(to disambiguate between MDY and DMY).

If this is correct (I'm beginning to think it's not), I'd like something 
like 'MDY, MDY', where dates are output as MDY by default (instead of 
ISO). That way I don't have to keep writing queries like "SELECT 
to_char(date_field, 'MM/DD/YYYY') FROM some_table"

> You need to read the manual a bit more closely, perhaps; or at
> least explain what your *actual* problem is.

Running the following, either directly in psql or upon connecting from a
webserver (php specifically), doesn't change the datestyle setting:
SET datestyle = 'US'
SET datestyle = 'MDY'
SET datestyle = 'MDY, MDY'

I was expecting it to change to something like 'MDY, MDY'.

Obviously I'm missing something here, just not sure what!


Karl Nack

Futurity, Inc.
773-506-2007

В списке pgsql-novice по дате отправления
От: Tom Lane
Дата:
Сообщение: Re: changing datestyle
От: Tom Lane
Дата:
Сообщение: Re: changing datestyle
FAQ