X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9B8A230F58E; Mon, 23 Jun 2003 17:35:49 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 19812-10; Mon, 23 Jun 2003 14:35:39 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id F034830F50C; Mon, 23 Jun 2003 14:35:38 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h5NHZdQQ002064; Mon, 23 Jun 2003 13:35:39 -0400 (EDT) To: Randall Lucas Cc: "Nicolas JOUANIN" , pgsql-sql@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: TR: Like and = In-reply-to: <3D4FE530-A59B-11D7-8248-000A957653D6@tercent.net> References: <3D4FE530-A59B-11D7-8248-000A957653D6@tercent.net> Comments: In-reply-to Randall Lucas message dated "Mon, 23 Jun 2003 12:53:39 -0400" Date: Mon, 23 Jun 2003 13:35:39 -0400 Message-ID: <2063.1056389739@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200306/270 X-Sequence-Number: 14028 Randall Lucas 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