X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 08B7852B8A for ; Mon, 15 Aug 2005 21:21:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69686-09 for ; Tue, 16 Aug 2005 00:21:27 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 378B052B25 for ; Mon, 15 Aug 2005 21:21:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j7G0LNrs018685; Mon, 15 Aug 2005 20:21:23 -0400 (EDT) To: Michael Fuhr Cc: Sebastian Siewior , pgsql-sql@postgresql.org Subject: Re: Problem with a Pettern Matching Check In-reply-to: <20050815224208.GA51332@winnie.fuhr.org> References: <20050816001950.2225e5b8@mikejones.ghb.fh-furtwangen.de> <20050815224208.GA51332@winnie.fuhr.org> Comments: In-reply-to Michael Fuhr message dated "Mon, 15 Aug 2005 16:42:08 -0600" Date: Mon, 15 Aug 2005 20:21:23 -0400 Message-ID: <18684.1124151683@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200508/105 X-Sequence-Number: 22333 Michael Fuhr writes: > The CHAR(3) specification causes the value to be space-padded, so > '1' becomes '1 ' (the digit "one" followed by two spaces). Actually, we seem to be going out of our way to make this case fail. Given that we consider trailing spaces in char(n) to be semantically insignificant, would it make sense to strip them before doing the regex pattern match? That would happen automatically if we allowed the char(n) value to promote to text --- and the only reason it's not doing so is that there's an extra ~ operator definition that specifically prevents that (bpcharregexeq). I have a feeling that we added that operator definition at some point for backwards compatibility, but it seems a bit odd now. regards, tom lane