Re[2]: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2)

Поиск
Список
Период
Сортировка
От Sferacarta Software
Тема Re[2]: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2)
Дата
Msg-id 16560.980826@bo.nettuno.it
обсуждение исходный текст
Ответ на Re: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2)  (Aleksey Dashevsky <postgres@luckynet.co.il>)
Список pgsql-interfaces
Hello Aleksey,

mercoledì, 26 agosto 98, you wrote:


AD> On Mon, 24 Aug 1998, Sangeeta Rao wrote:

>>
>> Hi,
>>
>> I am using Postgresql 6.3.2 and would like to set the datestyle to be ISO.
>>
>> Here is what I did:
>>
>> - issued "set datestyle='ISO' " using PQexec() after opening a connection
>> with the database. (no errors)
>> - Then checked the datestyle from psql
>> dbxxx=> show datestyle ;
>> response:
>> NOTICE: DateStyle is Postgres with US (NonEuropean) conventions.
>> - Also, when I open a jdbc connection with debug tracing on I notice that
>>  the datestyle is Postgres
>>
>> Why so?? Is this a bug or am I missing something?
>>
>> Instead of issuing 'set datestyle' command if I set the environment
>> variable
>> 'PGDATESTYLE' to ISO it works fine but I would like to avoid having to do
>> this.

AD> Setting datestyle variable has effect only for the session it was issued
AD> in. It was made so to avoid interfernce with another sessions since
AD> they could be started not only by you, but someone else (remember --
AD> PostgreSQL is multiusear). So, the solution is to run postmaster with
AD> "-e" turned on to get the datestyle you need by default-- for details
AD> check manpages postmaster(1) and postgres(1).
AD> Aleksey.


The -e option don't allows ISO format, it's a flag to set
European/NoEuropean.

from man postgres(1):

     -e   The -e option controls how dates  are  input  to  and
            output from the database.

            If  the  -e option is supplied, then all dates passed
            to and from the frontend processes will be assumed to
            be in European format ie.  DD-MM-YYYY otherwise dates
            are input and output in American format  ie.   MM-DD-
            YYYY


To setting date format you can use one of the following:

1. Setting PGDATESTYLE environment variable.

 2. Running postmaster using -oe parameter to set format
    date to 'European' convention.

 3. Changing the following variables:
         bool EuroDates = false / true
         int  DateStyle = USE_ISO_DATES
         on ~/src/backend/utils/init/globals.c file before PostgreSQL installation.


Best regards,
   Jose'                            mailto:sferac@bo.nettuno.it



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

Предыдущее
От: Aleksey Dashevsky
Дата:
Сообщение: Re: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2)
Следующее
От: David Hartwig
Дата:
Сообщение: Re: [SQL] excel vs. money data type?