pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Randall Lucas <rlucas@tercent.net>
Cc: Nicolas JOUANIN <n.jouanin@regie-france.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: TR: Like and =
Date: Mon, 23 Jun 2003 13:35:39 -0400
Message-ID: <2063.1056389739@sss.pgh.pa.us> (raw)
In-Reply-To: <3D4FE530-A59B-11D7-8248-000A957653D6@tercent.net>
References: <3D4FE530-A59B-11D7-8248-000A957653D6@tercent.net>

Randall Lucas <rlucas@tercent.net> writes:
> The LIKE operator takes a pattern, and since your pattern did not 
> specify a wildcard at the end, it didn't exactly match the padded 
> string.

> This behavior does seem kind of confusing; 

Yeah.  As of CVS tip, the system is actually going out of its way to
cause this to happen: if we deleted the separate ~~ operator for bpchar,
then the automatic rtrim() that now happens when converting bpchar to
text would cause the extra spaces to go away, and the LIKE would work
as Nicolas is expecting.  On the other hand, this would probably create
some backwards-compatibility issues, since existing uses of LIKE with
bpchar operands are no doubt using patterns that expect the spaces to be
there.  Any opinions whether we should change it or not?

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <2063.1056389739@sss.pgh.pa.us>
Permalink:  ../2063.1056389739@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2063.1056389739@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, rlucas@tercent.net, n.jouanin@regie-france.com, pgsql-hackers@postgresql.org
  Subject: Re: TR: Like and =
  In-Reply-To: <2063.1056389739@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