Re: BYTEA, indexes and "like"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvar Freude <alvar(at)a-blast(dot)org>
Cc: pgsql-general(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: BYTEA, indexes and "like"
Date: 2002-08-18 21:48:26
Message-ID: 8548.1029707306@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Alvar Freude <alvar(at)a-blast(dot)org> writes:
> it seems, that a BYTEA fiels doesn't support indexes in WHERE-Statement
> with a "like" condition:

I was somewhat bemused to discover that we even *have* a LIKE for bytea.
It does not seem to work real well:

regression=# create table foo (f1 bytea);
CREATE TABLE
regression=# select * from foo where f1 like 'z';
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

The server log shows
TRAP: FailedAssertion("!(((Const *) other)->consttype == 25)", File: "selfuncs.c", Line: 857)
LOG: server process (pid 8487) was terminated by signal 6

which traces down to the fact that patternsel() expects to see only TEXT
patterns. Joe, was it you that put this stuff in? If so, shame on you
for not using --enable-cassert when doing backend work.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2002-08-18 21:54:09 Re: BYTEA, indexes and "like"
Previous Message Joe Conway 2002-08-18 21:28:52 bytea operator bugs (was Re: [GENERAL] BYTEA, indexes and "like")

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2002-08-18 21:54:09 Re: BYTEA, indexes and "like"
Previous Message Peter Eisentraut 2002-08-18 21:35:30 Re: [PATCHES] Better handling of parse errors