Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.8.8/8.7.5) with ESMTP id HAA15700; Wed, 26 Aug 1998 07:24:57 -0400 (EDT) Received: from proxy.sferacarta.com (mail@ppp07-nas3.nettuno.it [193.207.156.240]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id NAA02092; Wed, 26 Aug 1998 13:24:32 +0200 (MDT) Received: from blu.sferacarta.com (mail.sferacarta.com) [10.20.30.12] by proxy.sferacarta.com with smtp (Exim 1.92 #1 (Debian)) id 0zBfRr-0002ae-00; Wed, 26 Aug 1998 13:17:15 +0000 Date: Wed, 26 Aug 1998 13:27:50 +0200 From: Sferacarta Software X-Mailer: The Bat! (v1.017) UNREG Reply-To: Sferacarta Software Organization: Sferacarta Software Priority: Normal Message-ID: <16560.980826@bo.nettuno.it> To: Sangeeta Rao , Aleksey Dashevsky , pgsql-general@postgresql.org, pgsql-interfaces@postgresql.org Subject: Re[2]: [GENERAL] Set DATESTYLE='ISO' (Postgres 6.3.2) References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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