Re: now() and date_trunc() apparently corrupting data

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: now() and date_trunc() apparently corrupting data
Date: 2003-03-14 10:22:27
Message-ID: 1047637346.1341.63.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 2003-03-13 at 23:06, Tom Lane wrote:
> Oliver Elphick <olly(at)lfix(dot)co(dot)uk> writes:
> > This is with -configure -enable-integer-datetime in 7.3.2, i386 Linux
> > platform. Is anyone else seeing this? If so, does it happen without
> > --enable-integer-datetime?
>
> > junk=# select * from mt;
> > v
> > --
> > 06:25:00+00
> > (1 row)
>
> > junk=# select * from mt where v < now();
> > v
> > --
> > 00:00:00+00 <-- data has been changed...
> > (1 row)
>
>
> I think this is explained by this bug:
>
> 2003-02-13 12:04 tgl
>
> * src/backend/utils/adt/date.c (REL7_3_STABLE): Prevent timetz2tm()
> from scribbling on its input in HAVE_INT64_TIMESTAMP case.
>
> Can you try it with CVS tip (either HEAD or REL7_3_STABLE branch)?

With HEAD it's OK -- no bug.

Applying that patch to 7.3.2 fixes it there a well. Thanks.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Let your light so shine before men, that they may see
your good works, and glorify your Father which is in
heaven." Matthew 5:16

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ennio Iannucci 2003-03-14 12:12:27 strange behaviour of extended ascii characters (LATIN1)
Previous Message Joshua Moore-Oliva 2003-03-14 04:39:03 RESOLUTION: Re: Bug in AT TIME ZONE contruct between EST and INTERVAL '-05:00' (resubmit now that I am a member of this list)