Re: I have a question about using index in order statement.

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: kevin <kevin(at)mail(dot)kinew(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: I have a question about using index in order statement.
Date: 2007-11-02 17:14:45
Message-ID: 472B5B05.1060201@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> The basic reason that there's a problem here is that the parser is
> playing fast and loose by generating ORDER BY information that cites
> "text < text" as the sort operator but applies it to a bare varchar
> Var node. So I thought about a Plan B of changing the parser to put
> a correct RelabelType on the sort key. I'm not sure of all the
> implications of that, though, and you could argue that it's an
> initdb-forcing change (because stored rules involving ORDER BY on
> varchar columns would need to change to work right). Seems a bit
> late in the 8.3 cycle for that.

I think mentioning it in the release notes would be enough. You would
just have to recreate the rules to make them work again, right?

> I guess the right answer is to fix equivclass.c to strip RelabelTypes,
> and hope to maybe take that out again someday when all this gets cleaned
> up.

That certainly looks like the easier solution. We still strip
RelabelTypes in many places anyway, so doing it in one more place
doesn't seem too bad to me.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Davis 2007-11-02 17:27:46 tsvector that can't be dumped/reloaded in 8.3beta
Previous Message Tom Lane 2007-11-02 16:21:30 Re: BUG #3713: problem with thread safety???