Hi,
Le 19/05/2010 00:15, Ermengol Bota a écrit :
> [...]
> I've seen that what I'm asking was discussed few years ago (2006) on this list
>
> http://archives.postgresql.org/pgadmin-support/2006-01/msg00042.php
>
> but I would like to know if it is still the same.
>
Yes.
> The problem (or the issue or whatever) is that (I think) pgadminIII
> doesn't recognize the variable datestyle, so it always sets it to:
> ISO, DMY.
>
It's not that it doesn't recognize it. It is that it changes it to ISO
on all its connections.
> So when you are exploring your data with the pgadmin tools you will
> always see dates formatted as
> yyyy-mm-dd
>
You're right.
> 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.
> I've changed the datesyle in the configuration file (postgresql.conf),
> so if I work from the command line with psql it shows dates as
> expected (postgres style), but inside pgadmin it always show
> yyyy-mm-dd even-thought you add the datestyle variable in the database
> properties tab also.
>
The datestyle property of a database is what you have if you don't
overrule it by a session changes.
> Am I missing something?
> Is this a correct behaviour?
At least, it's what's intended.
--
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com