Re: Zero-length character breaking query?

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: Doug Gorley <dgorley(at)aihs(dot)ca>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Zero-length character breaking query?
Date: 2012-03-16 19:09:12
Message-ID: 4F638FD8.6070206@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doug Gorley wrote:
>
> "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0 rows.
> "select * from tdt_unsent where str_name_l ~ '^SMITH'" returns 3 rows.
> "select * from tdt_unsent where str_name_l ~ '^SMITH$'" returns 0 rows.
> "select length(str_name_l) from tdt_unsent where str_name_l ~ '^SMITH'" returns "5".

what does the following return?
select str_name_l::bytea from tdt_unsent where str_name_l ~ '^SMITH';

It should show you any chars that don't usually display in your locale as
hex chars (i.e. \xNN).

Bosco.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2012-03-16 19:13:41 Re: BUG #6510: A simple prompt is displayed using wrong charset
Previous Message Raymond O'Donnell 2012-03-16 18:54:55 Re: Authenticating from a web service call