French date

Started by evon600cover 23 years ago5 messagesgeneral
Jump to latest
#1evon600c
jcelle@deolis.com

Hello,
Is there a simple way to configure the postgres server so that it always
understand the french date format 'dd/mm/yyyy' ?
Or is there a call i can perform in my client application that could
have the same effect ?

I wish i had not to set some easy forgetable environment variables such
as LC_TIME.

For instance in SQL Server i was able to issue a "set dateformat 'dmy'"
in the begining of all my transactions to get it done and that was fine
for me (and my customers...)

Many thank's in advance.

#2Jean-Michel Chabanne
jeanmichel.chabanne@free.fr
In reply to: evon600c (#1)
Re: French date

evon600c wrote:

Hello,
Is there a simple way to configure the postgres server so that it always
understand the french date format 'dd/mm/yyyy' ?
Or is there a call i can perform in my client application that could
have the same effect ?

I wish i had not to set some easy forgetable environment variables such
as LC_TIME.

For instance in SQL Server i was able to issue a "set dateformat 'dmy'"
in the begining of all my transactions to get it done and that was fine
for me (and my customers...)

Many thank's in advance.

Wen connected you may do SET DateStyle = 'SQL,European';

Or, with pgsql, before the connection you may export the variable
PGDATESTYLE='SQL,European'

This should work fine, but I have noticed that it does not work on one
of my DB and I don't know why.

--
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux

#3Bruce Momjian
bruce@momjian.us
In reply to: Jean-Michel Chabanne (#2)
Re: French date

]Jean-Michel Chabanne wrote:

evon600c wrote:

Hello,
Is there a simple way to configure the postgres server so that it always
understand the french date format 'dd/mm/yyyy' ?
Or is there a call i can perform in my client application that could
have the same effect ?

I wish i had not to set some easy forgetable environment variables such
as LC_TIME.

For instance in SQL Server i was able to issue a "set dateformat 'dmy'"
in the begining of all my transactions to get it done and that was fine
for me (and my customers...)

Many thank's in advance.

Wen connected you may do SET DateStyle = 'SQL,European';

Or, with pgsql, before the connection you may export the variable
PGDATESTYLE='SQL,European'

This should work fine, but I have noticed that it does not work on one
of my DB and I don't know why.

You can use set datestyle in postgresql.conf in 7.3.X. In 7.2, it had
to be an environment variable before the postmaster started, or us SET
as a command.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Jean-Michel Chabanne
jeanmichel.chabanne@free.fr
In reply to: evon600c (#1)
Re: French date

Jean-Michel Chabanne wrote:

evon600c wrote:

Hello,
Is there a simple way to configure the postgres server so that it
always understand the french date format 'dd/mm/yyyy' ?
Or is there a call i can perform in my client application that could
have the same effect ?

I wish i had not to set some easy forgetable environment variables
such as LC_TIME.
For instance in SQL Server i was able to issue a "set dateformat
'dmy'" in the begining of all my transactions to get it done and that
was fine for me (and my customers...)

Many thank's in advance.

Wen connected you may do SET DateStyle = 'SQL,European';

Or, with pgsql, before the connection you may export the variable
PGDATESTYLE='SQL,European'

This should work fine, but I have noticed that it does not work on one
of my DB and I don't know why.

Now I know why !!!

First I did in the first DB :

SET DateStyle = 'SQL,European';
Some SELECT queries ...

Then I changed the DB connection with " \c test ", but when I was
connected to test DB I had to type again SET DateStyle = 'SQL,European';

--
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux

#5Oliver Elphick
olly@lfix.co.uk
In reply to: evon600c (#1)
Re: French date

On Tue, 2002-12-31 at 10:10, evon600c wrote:

Hello,
Is there a simple way to configure the postgres server so that it always
understand the french date format 'dd/mm/yyyy' ?
Or is there a call i can perform in my client application that could
have the same effect ?

SET DATESTYLE TO 'ISO,EUROPEAN'

I wish i had not to set some easy forgetable environment variables such
as LC_TIME.

For release 7.3 you can add this line to postgresql.conf:

DATESTYLE = 'ISO,European'

In earlier releases, you could define the environment variable

export PGDATESTYLE=ISO,European

before starting the postmaster - you could include it in your startup
script.
--
Oliver Elphick <olly@lfix.co.uk>
LFIX Limited