isfinite(interval) malfunctions - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject isfinite(interval) malfunctions
Date
Msg-id 200101241913.f0OJDUu45423@hub.org
Whole thread Raw
List pgsql-bugs
Thomas F. O\'Connell (tfo@monsterlabs.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
isfinite(interval) malfunctions

Long Description
for the most part, i have been impressed with postgres' ability to handle dates. unfortunately, i have run across a
fairnumber of inconsistencies, such as the fact that certain constants lose their meaning even in contexts in which
theyappear to be defined. 

for example, the function

bool isfinite( interval )

exists in postgres but seems to serve no meaningful purpose, as it always returns true, even in the face of a query
suchas: 

select isfinite( timestamp 'infinity' - timestamp '-infinity' );

Sample Code
here is the exact sequence of steps necessary to produce the bug:

postgres]$ createdb foo
postgres]$ psql foo
foo=# select isfinite( timestamp 'infinity' - timestamp '-infinity' );

actual output:
 isfinite
----------
 t
(1 row)

expected output:
 isfinite
----------
 f
(1 row)


i compiled with all defaults except the install directory:
./configure  --prefix=/opt/pgsql

we use the startup script from the documentation.
it starts the database like this from rc.3:

PGACCOUNT="postgres"
POSTMASTER="postmaster"
FACILITY="local5"
PGLOGFILE="/tmp/postgres.log"
PGOPTS="-i -d 0"
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
su - ${PGACCOUNT} -c "(${POSTMASTER} ${PGOPTS} 2>&1 | logger -p
${FACILITY}.notice) &" > /dev/null 2>&1 &

the bug can be reproduced in both

PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66
and

PostgreSQL 7.1beta2 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66


platform info:

RedHat Linux 2.2.17 i686 unknown
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
256 MB RAM

No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Python interface with CFLAGS
Next
From: Bruce Momjian
Date:
Subject: Re: no way in LargeObject API to detect short read?