pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Howard Zuckman <marc@fallon.classyad.com>
Cc: pgsql-sql@hub.org
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [SQL] Functional Indexes
Date: Sun, 07 Feb 1999 22:18:35 -0500
Message-ID: <13890.918443915@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.02A.9902072132100.20192-100000@fallon.classyad.com>

Marc Howard Zuckman <marc@fallon.classyad.com> writes:
> On Mon, 8 Feb 1999, Sascha Schumann wrote:
>> funweb=> create unique index userdat_idx2 on userdat (lower(username)
>> varchar_ops);
>> ERROR:  BuildFuncTupleDesc: function 'lower(varchar)' does not exist
>> 
>> This error message looks very bogus to me.

> I don't think lower is defined for varchar arguments.  consider redefining
> username as type text and using text_ops.

I think Marc is right.  Someone was working on adding lower() to the
available ops for varchar for 6.5, but it's not there in 6.4.

You can get lower() to work on varchar source data in a simple
SELECT, but that's some sort of hack that involves the system
knowing that text and varchar have the same physical representation
so it's OK to use a function that takes text on a varchar column.
The type matching requirements for functional indexes are tighter.

Note to hackers: is there a good reason why indexes are more
restrictive?  Offhand it seems like the same physical-equivalence
trick could be applied.

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <13890.918443915@sss.pgh.pa.us>
Permalink:  ../13890.918443915@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13890.918443915@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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, marc@fallon.classyad.com, pgsql-sql@hub.org, pgsql-hackers@postgreSQL.org
  Subject: Re: [SQL] Functional Indexes
  In-Reply-To: <13890.918443915@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