Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8C298632C66 for ; Mon, 2 Feb 2009 20:43:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37568-05 for ; Mon, 2 Feb 2009 20:43:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4D539632C5B for ; Mon, 2 Feb 2009 20:43:48 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n130hk3m010867; Mon, 2 Feb 2009 19:43:46 -0500 (EST) To: "Haszlakiewicz, Eric" cc: pgsql-interfaces@postgresql.org Subject: Re: char columns, space padding, and the "like" operator In-reply-to: <9D29FD18CBD74A478CBA86E6EF6DBAD403394E01@CHI4EVS04.corp.transunion.com> References: <9D29FD18CBD74A478CBA86E6EF6DBAD403394D9A@CHI4EVS04.corp.transunion.com> <8609.1233610735@sss.pgh.pa.us> <9D29FD18CBD74A478CBA86E6EF6DBAD403394E01@CHI4EVS04.corp.transunion.com> Comments: In-reply-to "Haszlakiewicz, Eric" message dated "Mon, 02 Feb 2009 16:07:43 -0600" Date: Mon, 02 Feb 2009 19:43:46 -0500 Message-ID: <10866.1233621826@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/5 X-Sequence-Number: 6856 "Haszlakiewicz, Eric" writes: >> Cast the char(n) column to text or varchar, and it should work more >> like you're expecting. > Yeah, I figured that much. I was hoping for a connection-wide or > database-wide setting, so I wouldn't have to go change all my SQL > statements. Well, you could experiment with removing the char(n) variant of the ~~ operator, but if it breaks you get to keep both pieces. regards, tom lane