pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-admin@postgresql.org
Subject: Re: index not used in ( varchar = text )
Date: Mon, 24 Feb 2003 09:41:54 +0100
Message-ID: <b3clsg$o2q$1@news.hub.org> (raw)
References: <20971.1046051478@sss.pgh.pa.us>

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
Newsgroups: comp.databases.postgresql.admin
Sent: Monday, February 24, 2003 2:57 AM
Subject: Re: index not used in ( varchar = text )


> "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.

I did, and fortunatelly I found this behaviour before
to upgrade the production database.

> 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


Ciao
Gaetano.
html





view thread (6+ messages)  latest in thread

Message-ID: <b3clsg$o2q$1@news.hub.org>
Permalink:  ../b3clsg$o2q$1@news.hub.org/
Also on:    postgresql.org/message-id/b3clsg$o2q$1@news.hub.org

 · 

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: mendola@bigfoot.com
  Subject: Re: index not used in ( varchar = text )
  In-Reply-To: <b3clsg$o2q$1@news.hub.org>
  References: <20971.1046051478@sss.pgh.pa.us> <b3clsg$o2q$1@news.hub.org>

* 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