Re: nasty problem with redhat 6.2 + pg 7.02

From: leonbloy(at)sinectis(dot)com(dot)ar
To: pgsql-general(at)postgresql(dot)org
Subject: Re: nasty problem with redhat 6.2 + pg 7.02
Date: 2000-09-19 22:05:36
Message-ID: 200009192205.TAA13293@rye.sinectis.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)=(at)_;
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(at)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(at)bert postgres]$

If I intermix a disconnect/connect between the calls to doit()
I get:

[postgres(at)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(at)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(at)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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-09-19 22:22:32 Re: pqReadData() -- backend closed the channel unexpectedly
Previous Message Martin Gainty 2000-09-19 21:58:09 Re: Building Windows fat clients