Skip site navigation (1) Skip section navigation (2)

Re: Bug #747: PostgreSQL doesn't use indexes right sometimes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: j0-postgresql(at)johnzero(dot)hu, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #747: PostgreSQL doesn't use indexes right sometimes
Date: 2002-08-26 19:05:40
Message-ID: 1874.1030388740@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
pgsql-bugs(at)postgresql(dot)org writes:
> Summarized:
> timefield > 'now'::datetime   --> NO index
> timefield > 'now'::timestamp  --> index is used (OK)

"datetime" is an obsolete type name that will go away entirely in 7.3,
so I cannot get very excited about this.  But I believe the issue is
that "timestamp" really means "timestamp with time zone" (in 7.2 anyway)
while "datetime" is translated to "timestamp without time zone", and
from there you fall into the usual traps involving cross-datatype
comparisons.

You'd be well advised to fix all your queries to read
	::timestamp with time zone
to make them SQL-spec-compliant and unlikely to break in 7.3.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2002-08-26 22:57:36
Subject: Re: Bug #693: python interface doesn't handle int8 correctly.
Previous:From: pgsql-bugsDate: 2002-08-26 18:26:13
Subject: Bug #747: PostgreSQL doesn't use indexes right sometimes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group