Re: Like vs '=' bug with indexing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Like vs '=' bug with indexing
Date
Msg-id 4392.981239269@sss.pgh.pa.us
Whole thread Raw
In response to Re: Like vs '=' bug with indexing  (m w <mttf2000@yahoo.com>)
Responses Re: Like vs '=' bug with indexing  (m w <mttf2000@yahoo.com>)
List pgsql-hackers
m w <mttf2000@yahoo.com> writes:
> I think this exposes a bug in postgres where either
> index or table scans (I'm not sure which just yet)
> treat a zero differently than a non-zero in a varchar.

Embedded zeroes aren't supported in char/varchar/text fields,
and cannot be supported in a portable fashion, since these datatypes
rely on functions like strcoll() that don't allow embedded nulls in
strings.  It wouldn't surprise me too much if there are inconsistent
behaviors between indexscans and seqscans for such invalid data.

It doesn't seem real practical for us to examine the output of every
C-coded function to make sure it produces a valid value of the datatype.
Illegal returned values are a fault of the function, and ensuing
misbehaviors are still its fault ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: m w
Date:
Subject: Re: Like vs '=' bug with indexing
Next
From: m w
Date:
Subject: Re: Like vs '=' bug with indexing