Re: datestyle issue. Is it always set to ISO, DMY ?

Поиск
Список
Период
Сортировка
От Ermengol Bota
Тема Re: datestyle issue. Is it always set to ISO, DMY ?
Дата
Msg-id AANLkTil5lRxOgCI4La5UQY09rj4Watgn9JAsbu83jZMb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: datestyle issue. Is it always set to ISO, DMY ?  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgadmin-support
2010/5/19 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 19/05/2010 00:15, Ermengol Bota a écrit :
> ...
>> But, if you are on the query tool you can change this behaviour with
>> (for example)
>> set datestyle = "postgres, euro";
>>
>> and then if you select a column with dates they will formatted the european way
>> dd-mm-yyyy
>> ...
>
> Sure, you bypassed pgAdmin session configuration, so pgAdmin displayed
> dates in the datestyle you specified on the session.
>
> pgAdmin got a result from PostgreSQL and it displays it in the same way.
> It doesn't change the string it receives. It displays ISO by default
> because, when it connects to a database, the first query it launches is
> a "SET DateStyle=ISO;". It'll display with another style if you changes
> the DateStyle parameter of the session.


First of all, thank you  for your fast answer and clear explanations.
Second :-), I'm not a database administrator, I'm just a teacher on a
software engineering subject at the university where we use postgres.
So, you are the experts, and probably the real users :-)

But, there is one thing that I don't understand.
I agree that is a good convention to force the datestyle wherever
pgadmin is running (even though when using a JDBC connection it
usually sets datestyle according to the SO locale or the one indicated
in the connection string), this way, pgadmin will always show the
dates the same way. Ok, no problem :-)

But, as far as you can set DataStyle variable for each database, maybe
could be a good idea that when connecting to a database that has this
variable setted not to "overwrite" it with the default (ISO).

( ALTER DATABASE aDtabase SET DateStyle='postgres, euro'; )


The idea is that if a database has the variable datestyle setted use
it, otherwise use ISO

Well, it's just an opinion :-)

And thanks for this great tool!

--
* Ermengol *
*************************************************
* Els ordinadors no resolen problemes, *
* simplement executen solucions           *
*************************************************


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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: datestyle issue. Is it always set to ISO, DMY ?
Следующее
От: "Little, Douglas"
Дата:
Сообщение: Query results grid copy header