Thread: set datestyle to European PROBLEM

set datestyle to European PROBLEM

From
Alessandro Rossi
Date:
I have the defaul installation of postgres 7.0.3 and on another machine
7.1.2 on redhat 7.1

I cannont get the date in correct form:

dbme=# select data_ar from equipment limit 5; data_ar   
------------2001-11-052001-05-172001-05-282001-05-282001-05-22
(5 rows)

then:

dbme=# set datestyle to European;
SET VARIABLE

dbme=# select data_ar from equipment limit 5; data_ar
------------2001-11-052001-05-172001-05-282001-05-282001-05-22
(5 rows)

Is this a bug ?

I think i should get dd-mm-yyy date format and not yyyy-mm-dd 



Is postgres using ISO date format as default ?

Thanks

Alex




Re: set datestyle to European PROBLEM

From
George Moga
Date:
Alessandro Rossi wrote:

> I have the defaul installation of postgres 7.0.3 and on another machine
> 7.1.2 on redhat 7.1
>
> I cannont get the date in correct form:

.....

> Is this a bug ?
>
> I think i should get dd-mm-yyy date format and not yyyy-mm-dd
>
> Is postgres using ISO date format as default ?

I had the same problem ... but I solved ...
(I use PostgreSQL 7.1 on RH 7.1 installed from rpm):

In "/etc/rc.d/init.d/postgresql" I modify in "start" arm ... from:
su -l postgres -c "LC_ALL=C /usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster start >/dev/null 2>&1" < /dev/null

to

su -l postgres -c "LC_ALL=C /usr/bin/pg_ctl -D $PGDATA -o '-i -o -e' -p
/usr/bin/postmaster start >/dev/null 2>&1" < /dev/null

and, after I connect my application to the database, the first command is:

SET DATESTYLE TO 'Postgres';

and work fine ...


> Thanks

> Alex

George Moga,   Data Systems Srl,   Slobozia, ROMANIA




Re: set datestyle to European PROBLEM

From
Roelof Sondaar
Date:
Hello Alessandro,

The manual I have says the following about Date/Time Styles:
- 4 styles (ISO-8601, SQL, Postgres, German)
The one which resembles your layout is German.
I looked it up in Bruce Momjians book.

Best regards,
Roelof


Alessandro Rossi schreef:
> 
> I have the defaul installation of postgres 7.0.3 and on another machine
> 7.1.2 on redhat 7.1
> 
> I cannont get the date in correct form:
> 
> dbme=# select data_ar from equipment limit 5;
>   data_ar
> ------------
>  2001-11-05
>  2001-05-17
>  2001-05-28
>  2001-05-28
>  2001-05-22
> (5 rows)
> 
> then:
> 
> dbme=# set datestyle to European;
> SET VARIABLE
> 
> dbme=# select data_ar from equipment limit 5;
>   data_ar
> ------------
>  2001-11-05
>  2001-05-17
>  2001-05-28
>  2001-05-28
>  2001-05-22
> (5 rows)
> 
> Is this a bug ?
> 
> I think i should get dd-mm-yyy date format and not yyyy-mm-dd
> 
> Is postgres using ISO date format as default ?
> 
> Thanks
> 
> Alex
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

-- 
Roelof Sondaar
WM-data Zwolle B.V.
Russenweg 5
P O Box 391
8000 AJ  ZWOLLE
The Netherlands

E-mail:    roelof.sondaar@wmdata.nl
Telephone:+31(0)384 977 366
Fax:    +31(0)384 977 600
WWW:    www.wmdata.nl

*******************************************************
Disclaimer

This email is confidential and intended solely for the use of
the individual to whom it is addressed. Any views or opinions
presented are solely those of the author and do not
necessarily represent those of WM-data Zwolle B.V.
If you are not the intended recipient, be advised that you
have received this email in error and that any use,
dissemination, forwarding, printing or copying of this email
is strictly prohibited.

If you have received this email in error please notify
WM-data Zwolle B.V.  Helpdesk by telephone on
+31(0)384 977 319
*******************************************************