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

* Problem with data format
@ 2004-03-06 00:15  Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
  0 siblings, 2 replies; 5+ messages in thread

From: Dario Ottaviano @ 2004-03-06 00:15 UTC (permalink / raw)
  To: pgsql-admin

Hi, i use Postgresql 7.2 on a windows server (Win 2000 Server).
The problem is that when i write a date into a timestamp field of a table,
it writes it in to No-Europe format.

So, for istance, if i write the date: 04/03/2004 (4 Mar 2004), it writes the
date 03/04/2004 (3 Apr 2004) into the table .

Why?
Is there a way to avoid this?

Tanck you for help!
Dario







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

* Re: Problem with data format
@ 2004-03-06 05:45  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2004-03-06 05:45 UTC (permalink / raw)
  To: Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>; +Cc: pgsql-admin

"Dario Ottaviano" <dario_ottaviano@togliquestovirgilio.it> writes:
> So, for istance, if i write the date: 04/03/2004 (4 Mar 2004), it writes the
> date 03/04/2004 (3 Apr 2004) into the table .

You need to change the DateStyle setting to agree with your desired
format.

			regards, tom lane



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

* Re: Problem with data format
@ 2004-03-06 20:39  Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Dario Ottaviano @ 2004-03-06 20:39 UTC (permalink / raw)
  To: pgsql-admin

That's ok, but how can i do that?
I tried something like "Set datestyle='European', but nothing changed!

Please, can you help me!
Thank you,
Dario Ottaviano


"Tom Lane" <tgl@sss.pgh.pa.us> ha scritto nel messaggio
news:14254.1078551909@sss.pgh.pa.us...
> "Dario Ottaviano" <dario_ottaviano@togliquestovirgilio.it> writes:
> > So, for istance, if i write the date: 04/03/2004 (4 Mar 2004), it writes
the
> > date 03/04/2004 (3 Apr 2004) into the table .
>
> You need to change the DateStyle setting to agree with your desired
> format.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>





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

* Re: Problem with data format
@ 2004-03-08 19:42  scott.marlowe <scott.marlowe@ihs.com>
  parent: Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
  1 sibling, 0 replies; 5+ messages in thread

From: scott.marlowe @ 2004-03-08 19:42 UTC (permalink / raw)
  To: Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>; +Cc: pgsql-admin

On Sat, 6 Mar 2004, Dario Ottaviano wrote:

> Hi, i use Postgresql 7.2 on a windows server (Win 2000 Server).
> The problem is that when i write a date into a timestamp field of a table,
> it writes it in to No-Europe format.

7.2 had some issues with accepting the wrong date formats and just 
mangling them until they fit, whether it made sense or not (i.e. you could 
insert a date of the format 2003-22-03, which should be illegal, and it 
would swap it around and insert 2003-03-22)  The fixes are in 7.3 and 
later, I'd suggest upgrading to 7.4.x if you want proper bounds checking 
on dates.

> So, for istance, if i write the date: 04/03/2004 (4 Mar 2004), it writes the
> date 03/04/2004 (3 Apr 2004) into the table .

while 7.2 allows you to set a european or US date style, it will gladly 
swap months and days to get a date it can insert.  Better, in my opinion, 
to use 7.3/7.4 which enforce the date style you set.




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

* Re: Problem with data format
@ 2004-03-09 21:59  scott.marlowe <scott.marlowe@ihs.com>
  parent: Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
  0 siblings, 0 replies; 5+ messages in thread

From: scott.marlowe @ 2004-03-09 21:59 UTC (permalink / raw)
  To: Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>; +Cc: pgsql-admin

What version of Postgresql are you running.  Versions 7.2 and before would 
gladly swap around day / month when they needed to be to fit, and this 
caused me a few headaches where I had data feeds that were partially 
failing and couldn't figure out why.

On Sat, 6 Mar 2004, Dario Ottaviano wrote:

> That's ok, but how can i do that?
> I tried something like "Set datestyle='European', but nothing changed!
> 
> Please, can you help me!
> Thank you,
> Dario Ottaviano
> 
> 
> "Tom Lane" <tgl@sss.pgh.pa.us> ha scritto nel messaggio
> news:14254.1078551909@sss.pgh.pa.us...
> > "Dario Ottaviano" <dario_ottaviano@togliquestovirgilio.it> writes:
> > > So, for istance, if i write the date: 04/03/2004 (4 Mar 2004), it writes
> the
> > > date 03/04/2004 (3 Apr 2004) into the table .
> >
> > You need to change the DateStyle setting to agree with your desired
> > format.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> >                http://archives.postgresql.org
> >
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 




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


end of thread, other threads:[~2004-03-09 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-06 00:15 Problem with data format Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
2004-03-06 05:45 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-03-06 20:39   ` Dario Ottaviano <dario_ottaviano@togliquestovirgilio.it>
2004-03-09 21:59     ` scott.marlowe <scott.marlowe@ihs.com>
2004-03-08 19:42 ` scott.marlowe <scott.marlowe@ihs.com>

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