pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Sun, 23 Feb 2003 20:51:18 -0500
Message-ID: <20971.1046051478@sss.pgh.pa.us> (raw)
In-Reply-To: <b3b8da$61d$1@news.hub.org>
References: <1046023648.9730.23.camel@localhost.localdomain>
	<b3b8da$61d$1@news.hub.org>

"Gaetano Mendola" <mendola@bigfoot.com> writes:
>> Why would you want to cast that to text, if your field is a varchar?

> Of course that example was a semplification of a real
> situation:
> ..........
> my_login ALIAS FOR $1;

> SELECT *
> FROM user_login
> WHERE login = my_login;

> and $1 is of type TEXT.

So declare it as VARCHAR.  Or cast it to varchar.  You need to get rid
of the datatype ambiguity.  "text = text" is a different operator from
"varchar = varchar".

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <20971.1046051478@sss.pgh.pa.us>
Permalink:  ../20971.1046051478@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20971.1046051478@sss.pgh.pa.us

 · 

reply

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: <20971.1046051478@sss.pgh.pa.us>
  References: <1046023648.9730.23.camel@localhost.localdomain> <b3b8da$61d$1@news.hub.org> <20971.1046051478@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