Re: char columns, space padding, and the "like" operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Haszlakiewicz, Eric" <EHASZLA(at)transunion(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: char columns, space padding, and the "like" operator
Date: 2009-02-03 00:43:46
Message-ID: 10866.1233621826@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

"Haszlakiewicz, Eric" <EHASZLA(at)transunion(dot)com> 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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bob Henkel 2009-02-24 01:04:04 C Stored Function with ECPG
Previous Message Haszlakiewicz, Eric 2009-02-02 22:07:43 Re: char columns, space padding, and the "like" operator