pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem Setting DateStyle
7+ messages / 5 participants
[nested] [flat]

* Problem Setting DateStyle
@ 2006-06-26 13:55 Andy <frum@ar-sd.net>
  2006-06-26 14:50 ` Re: Problem Setting DateStyle Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Andy @ 2006-06-26 13:55 UTC (permalink / raw)
  To: pgsql-admin

I want to have the DD/MM/YYYY date format in my database without to specify it with:
SET DateStyle='SQL, DMY' at every query. 

I tried to modify it in postgres.conf >>> datestyle = 'European' or datestyle = 'SQL, DMY'
and I tried to make 
alter database test5 SET DateStyle='SQL, DMY';

.... none of these worked. 

If I run in a session 
SET DateStyle='SQL, DMY' 
then it is ok for that session. 

How can I make it default for the whole system or at least for some databases?

OS: Suse 10, pgsql 8.0.3.

Regards,

Andy.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Problem Setting DateStyle
  2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
@ 2006-06-26 14:50 ` Tom Lane <tgl@sss.pgh.pa.us>
  2006-06-26 15:15   ` Re: Problem Setting DateStyle Andy <frum@ar-sd.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2006-06-26 14:50 UTC (permalink / raw)
  To: Andy <frum@ar-sd.net>; +Cc: pgsql-admin

"Andy" <frum@ar-sd.net> writes:
> I tried to modify it in postgres.conf >>> datestyle = 'European' or 
> datestyle = 'SQL, DMY'
> and I tried to make
> alter database test5 SET DateStyle='SQL, DMY';

> .... none of these worked.

They work for me.  Perhaps you should show us exactly what you did and
what happened.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Problem Setting DateStyle
  2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 14:50 ` Re: Problem Setting DateStyle Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-06-26 15:15   ` Andy <frum@ar-sd.net>
  2006-06-26 15:59     ` Re: Problem Setting DateStyle Alvaro Herrera <alvherre@commandprompt.com>
  2006-06-26 16:11     ` Re: Problem Setting DateStyle Scott Marlowe <smarlowe@g2switchworks.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Andy @ 2006-06-26 15:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

Steps:
1.
show datestyle
      DateStyle
      ISO, DMY


2.
set datestyle to 'SQL, DMY';
show datestyle;
      DateStyle
      SQL, DMY

>>>>>>>>>> this should be the good result.

Now the tries:
Edit the postgresql.conf. Set datestyle = 'SQL, DMY' parameter. Restart the 
DB server.
show datestyle
      DateStyle
      ISO, DMY

... there is no change.

the other try:
alter database test2 set datestyle to 'SQL, DMY';
SQL executed.
show datestyle
      DateStyle
      ISO, DMY


the same...

Am I missing something??? If I set
set datestyle to 'SQL, DMY' in a connection session then it works well for 
that session.

I need this type of format:
      auftragsdatum
      27/06/2005
      27/06/2005
      27/06/2005
      27/06/2005
      27/06/2005
      27/06/2005
      21/11/2005
      09/12/2005
      07/07/2005
      29/06/2005


I don't know what am I missing in the configuration.
I attach the postgres.conf.


Best regards,
Andy.




----- Original Message ----- 
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Andy" <frum@ar-sd.net>
Cc: <pgsql-admin@postgresql.org>
Sent: Monday, June 26, 2006 5:50 PM
Subject: Re: [ADMIN] Problem Setting DateStyle


> "Andy" <frum@ar-sd.net> writes:
>> I tried to modify it in postgres.conf >>> datestyle = 'European' or
>> datestyle = 'SQL, DMY'
>> and I tried to make
>> alter database test5 SET DateStyle='SQL, DMY';
>
>> .... none of these worked.
>
> They work for me.  Perhaps you should show us exactly what you did and
> what happened.
>
> regards, tom lane
>
> 

Attachments:

  postgresql.conf (application/octet-stream, 11.6K) download

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Problem Setting DateStyle
  2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 14:50 ` Re: Problem Setting DateStyle Tom Lane <tgl@sss.pgh.pa.us>
  2006-06-26 15:15   ` Re: Problem Setting DateStyle Andy <frum@ar-sd.net>
@ 2006-06-26 15:59     ` Alvaro Herrera <alvherre@commandprompt.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Alvaro Herrera @ 2006-06-26 15:59 UTC (permalink / raw)
  To: Andy <frum@ar-sd.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

Andy wrote:

> Now the tries:
> Edit the postgresql.conf. Set datestyle = 'SQL, DMY' parameter. Restart the 
> DB server.
> show datestyle
>      DateStyle
>      ISO, DMY

Perhaps you edited the wrong postgresql.conf file, or restarted the
wrong server, or forgot to uncomment the line.



-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Problem Setting DateStyle
  2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 14:50 ` Re: Problem Setting DateStyle Tom Lane <tgl@sss.pgh.pa.us>
  2006-06-26 15:15   ` Re: Problem Setting DateStyle Andy <frum@ar-sd.net>
@ 2006-06-26 16:11     ` Scott Marlowe <smarlowe@g2switchworks.com>
  2006-06-27 00:20       ` Re: Problem Setting DateStyle Aaron Bono <postgresql@aranya.com>
  1 sibling, 1 reply; 7+ messages in thread

From: Scott Marlowe @ 2006-06-26 16:11 UTC (permalink / raw)
  To: Andy <frum@ar-sd.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

On Mon, 2006-06-26 at 10:15, Andy wrote:
> Steps:
> 1.
> show datestyle
>       DateStyle
>       ISO, DMY
> 
> 
> 2.
> set datestyle to 'SQL, DMY';
> show datestyle;
>       DateStyle
>       SQL, DMY
> 
> >>>>>>>>>> this should be the good result.
> 
> Now the tries:
> Edit the postgresql.conf. Set datestyle = 'SQL, DMY' parameter. Restart the 
> DB server.
> show datestyle
>       DateStyle
>       ISO, DMY
> 
> ... there is no change.
> 
> the other try:
> alter database test2 set datestyle to 'SQL, DMY';
> SQL executed.
> show datestyle
>       DateStyle
>       ISO, DMY
> 
> 
> the same...


Have you set a date style for this particular database (not the cluster)
with an alter database statement before?

I'd try to alter the database to have a certain datestyle and see if
that helps.



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Problem Setting DateStyle
  2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 14:50 ` Re: Problem Setting DateStyle Tom Lane <tgl@sss.pgh.pa.us>
  2006-06-26 15:15   ` Re: Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 16:11     ` Re: Problem Setting DateStyle Scott Marlowe <smarlowe@g2switchworks.com>
@ 2006-06-27 00:20       ` Aaron Bono <postgresql@aranya.com>
  2006-06-27 07:12         ` Re: [SOLVED] Problem Setting DateStyle Andy <frum@ar-sd.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Aaron Bono @ 2006-06-27 00:20 UTC (permalink / raw)
  To: Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: Andy <frum@ar-sd.net>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

Also, and I know this sounds stupid, you may check to see if the database
really restarted.  I recently got a new server and for some reason when I
use the restart script found in /etc/init.d/postgres it doesn't actually
restart the server (the shutdown fails) but when I go to the control panel
installed by my ISP it restarts wonderfully.  I saw what was happening when
I looked at the date the postgres process started.

-Aaron

On 6/26/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
>
> On Mon, 2006-06-26 at 10:15, Andy wrote:
> > Steps:
> > 1.
> > show datestyle
> >       DateStyle
> >       ISO, DMY
> >
> >
> > 2.
> > set datestyle to 'SQL, DMY';
> > show datestyle;
> >       DateStyle
> >       SQL, DMY
> >
> > >>>>>>>>>> this should be the good result.
> >
> > Now the tries:
> > Edit the postgresql.conf. Set datestyle = 'SQL, DMY' parameter. Restart
> the
> > DB server.
> > show datestyle
> >       DateStyle
> >       ISO, DMY
> >
> > ... there is no change.
> >
> > the other try:
> > alter database test2 set datestyle to 'SQL, DMY';
> > SQL executed.
> > show datestyle
> >       DateStyle
> >       ISO, DMY
> >
> >
> > the same...
>
>
> Have you set a date style for this particular database (not the cluster)
> with an alter database statement before?
>
> I'd try to alter the database to have a certain datestyle and see if
> that helps.
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SOLVED] Problem Setting DateStyle
  2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 14:50 ` Re: Problem Setting DateStyle Tom Lane <tgl@sss.pgh.pa.us>
  2006-06-26 15:15   ` Re: Problem Setting DateStyle Andy <frum@ar-sd.net>
  2006-06-26 16:11     ` Re: Problem Setting DateStyle Scott Marlowe <smarlowe@g2switchworks.com>
  2006-06-27 00:20       ` Re: Problem Setting DateStyle Aaron Bono <postgresql@aranya.com>
@ 2006-06-27 07:12         ` Andy <frum@ar-sd.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Andy @ 2006-06-27 07:12 UTC (permalink / raw)
  To: Aaron Bono <postgresql@aranya.com>; Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

Ups, sorry folks, 

I use pgadmin3 for database access and it seems that it executes SET DateStyle=ISO; every time it connects. 
Same with phppgadmin4. If i connect with psql then it works fine. 

Anyway good to know. 

Best regards,
Andy.

  ----- Original Message ----- 
  From: Aaron Bono 
  To: Scott Marlowe 
  Cc: Andy ; Tom Lane ; pgsql-admin@postgresql.org 
  Sent: Tuesday, June 27, 2006 3:20 AM
  Subject: Re: [ADMIN] Problem Setting DateStyle


  Also, and I know this sounds stupid, you may check to see if the database really restarted.  I recently got a new server and for some reason when I use the restart script found in /etc/init.d/postgres it doesn't actually restart the server (the shutdown fails) but when I go to the control panel installed by my ISP it restarts wonderfully.  I saw what was happening when I looked at the date the postgres process started. 

  -Aaron


  On 6/26/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
    On Mon, 2006-06-26 at 10:15, Andy wrote:
    > Steps:
    > 1.
    > show datestyle
    >       DateStyle
    >       ISO, DMY
    >
    >
    > 2.
    > set datestyle to 'SQL, DMY';
    > show datestyle; 
    >       DateStyle
    >       SQL, DMY
    >
    > >>>>>>>>>> this should be the good result.
    >
    > Now the tries:
    > Edit the postgresql.conf. Set datestyle = 'SQL, DMY' parameter. Restart the 
    > DB server.
    > show datestyle
    >       DateStyle
    >       ISO, DMY
    >
    > ... there is no change.
    >
    > the other try:
    > alter database test2 set datestyle to 'SQL, DMY';
    > SQL executed.
    > show datestyle
    >       DateStyle
    >       ISO, DMY
    >
    >
    > the same...


    Have you set a date style for this particular database (not the cluster)
    with an alter database statement before? 

    I'd try to alter the database to have a certain datestyle and see if
    that helps.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2006-06-27 07:12 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-26 13:55 Problem Setting DateStyle Andy <frum@ar-sd.net>
2006-06-26 14:50 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-06-26 15:15   ` Andy <frum@ar-sd.net>
2006-06-26 15:59     ` Alvaro Herrera <alvherre@commandprompt.com>
2006-06-26 16:11     ` Scott Marlowe <smarlowe@g2switchworks.com>
2006-06-27 00:20       ` Aaron Bono <postgresql@aranya.com>
2006-06-27 07:12         ` Andy <frum@ar-sd.net>

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