pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sferacarta Software <sferac@bo.nettuno.it>
To: Sangeeta Rao <Sangeeta_Rao@mw.3com.com>
To: Aleksey Dashevsky <postgres@luckynet.co.il>
To: pgsql-general@postgresql.org
To: pgsql-interfaces@postgresql.org
Subject: Re[2]: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2)
Date: Wed, 26 Aug 1998 13:27:50 +0200
Message-ID: <16560.980826@bo.nettuno.it> (raw)
References: <Pine.LNX.3.96.SK.980826101241.30103A-100000@kesha.luckynet.co.il>

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





Message-ID: <16560.980826@bo.nettuno.it>
Permalink:  ../16560.980826@bo.nettuno.it/
Also on:    postgresql.org/message-id/16560.980826@bo.nettuno.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: sferac@bo.nettuno.it, Sangeeta_Rao@mw.3com.com, postgres@luckynet.co.il, pgsql-general@postgresql.org
  Subject: Re: Re[2]: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2)
  In-Reply-To: <16560.980826@bo.nettuno.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox