Обсуждение: Bug #803: Problem with timestamp conversion

Поиск
Список
Период
Сортировка

Bug #803: Problem with timestamp conversion

От
pgsql-bugs@postgresql.org
Дата:
Osmar Junior Klock (sysop@jfpr.gov.br) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Problem with timestamp conversion

Long Description
I tried
SELECT * FROM Noticia WHERE data >= CURRENT_DATE - 10
and returns: Unable to convert data to tm.
However:
SELECT * FROM Noticia WHERE data >= CURRENT_DATE - 11
it works.

Today is 23/10/2002. There's a problem with 13/10/2002 and 23/10/2002.



I'm using
FreeBSD venus 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #0:
Postgresql 7.2.1
enviroment variable PGDATESTYLE = German

Sample Code


No file was uploaded with this report

Re: Bug #803: Problem with timestamp conversion

От
Tom Lane
Дата:
pgsql-bugs@postgresql.org writes:
> SELECT * FROM Noticia WHERE data >= CURRENT_DATE - 10
> and returns: Unable to convert data to tm.

Curious.  This seems to indicate that mktime() is failing, which
as far as I can see it should not do.  Is 13/10/2002 a daylight-savings
transition day in your timezone?  What is your timezone, anyway?

You might find that updating to PG 7.2.3 solves your problem.  We put
in a hack to work around mktime() breakage in recent glibc versions.
Even though your case does not seem to directly relate to that issue,
the new code should cover up mktime's problem anyway.

            regards, tom lane