From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: index not used in ( varchar = text )
Date: Mon, 24 Feb 2003 09:35:36 -0500
Message-ID: <3085.1046097336@sss.pgh.pa.us> (raw)
In-Reply-To: <b3clsg$o2q$1@news.hub.org>
References: <20971.1046051478@sss.pgh.pa.us>
<b3clsg$o2q$1@news.hub.org>
"Gaetano Mendola" <mendola@bigfoot.com> writes:
>> You need to get rid
>> of the datatype ambiguity. "text = text" is a different operator from
>> "varchar = varchar".
> Yes I agree but was not like this in the Postgres 7.2.X version
That was a bug, or at least a horridly misdesigned behavior. The
operator chosen by the parser is "text = text" (because text is the
preferred datatype in the string class). Leaving aside any issues
about whether the parser's choice is correct, it is surely no business
of the planner to replace that choice with "varchar = varchar" ---
but that's what it was doing. The folly of this idea can be seen by
realizing that the same code would equally happily replace it with
"char = char", which has distinctly different semantics.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, mendola@bigfoot.com
Subject: Re: index not used in ( varchar = text )
In-Reply-To: <3085.1046097336@sss.pgh.pa.us>
References: <20971.1046051478@sss.pgh.pa.us> <b3clsg$o2q$1@news.hub.org> <3085.1046097336@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox