Re: nasty problem with redhat 6.2 + pg 7.02
От | leonbloy@sinectis.com.ar |
---|---|
Тема | Re: nasty problem with redhat 6.2 + pg 7.02 |
Дата | |
Msg-id | 200009192205.TAA13293@rye.sinectis.com.ar обсуждение исходный текст |
Ответ на | nasty problem with redhat 6.2 + pg 7.02 (leonbloy@sinectis.com.ar) |
Ответы |
Re: nasty problem with redhat 6.2 + pg 7.02
|
Список | pgsql-general |
Tom Lane wrote: >> Timezone is set to America/Buenos Aires >> Changing this seems to elliminate the bug. > What did you change it *to*, exactly? And what dates did you test > after changing? I changed to "Etc/GMT+4" and tested the same just the same dates >>>>>>>>>>>>>>>>>>>>>>>>> Edward Q. Bridges wrote: >i compiled/installed postgres from a tarball. are you > using the RPM? or did you compile from scratch? I compiled the sources too. >>>>>>>>>>>>> Tom Lane wrote: >I'll bet there is some bit of internal state somewhere that affects >the results. It could be inside libc, or it could be in Postgres. postgres, I would tend to think... For one thing I've just found out: the 'histeresis' effect occurs only WITHIN A CONNECTION: If I run this script: #################################### # !/usr/bin/perl use DBI; $host = 'localhost'; $db = 'test5'; my $db1; $db1 = DBI->connect("dbi:Pg:dbname=$db; host=$host;port=5432",'postgres',''); doit('01-10-2000'); doit('13-10-2000'); doit('01-10-2000'); sub doit { my($fecha)=@_; my $sth = $db1->prepare("SELECT '$fecha'::date::timestamp"); my $rv = $sth->execute; my ($x)=$sth->fetchrow_array; print "$fecha => $x\n"; } #####################################3 I get: [postgres@bert postgres]$ perl pru.pl 01-10-2000 => Sat 30 Sep 23:00:00 2000 ART 13-10-2000 => Fri 13 Oct 00:00:00 2000 ARST 01-10-2000 => Sat 30 Sep 00:00:00 2000 ART [postgres@bert postgres]$ If I intermix a disconnect/connect between the calls to doit() I get: [postgres@bert postgres]$ perl pru.pl 01-10-2000 => Sat 30 Sep 23:00:00 2000 ART 13-10-2000 => Fri 13 Oct 00:00:00 2000 ARST 01-10-2000 => Sat 30 Sep 23:00:00 2000 ART [postgres@bert postgres]$ By the way, on another redhat 6.1 machine (fortunately, my postgres producion server) with the same timezone, the results are just right: [postgres@crisol postgres]$ perl pru.pl 01-10-2000 => Sun 01 Oct 00:00:00 2000 ART 13-10-2000 => Fri 13 Oct 00:00:00 2000 ART 01-10-2000 => Sun 01 Oct 00:00:00 2000 ART This is getting a little boring for the rest of the list, i suppose... should I send this to the hackers list? or mail it privately ? Regards. Hernan Gonzalez Argentina
В списке pgsql-general по дате отправления: