Re: Non-standard escape sequences from Crystal Reports

From: Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com>
To: Rob Richardson <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Non-standard escape sequences from Crystal Reports
Date: 2010-10-05 18:33:22
Message-ID: AANLkTikOgJ2zCEZotYmTQ6RhzrkuqayCiS7L9N7Dp6_N@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Rob,
Please do not go offlist.

Its not a matter of cancelling,
consider the fragment --> relname like 'coil\\_status'
the underscore has to be escaped because if its not done
'_' will match any *single* character (rule of ilike matching) ,
its escaped so that it matches '_' in strings.
two backslash is required so that ilike gets \_
it is the rule of quoting literal values in sql.

if you can add E you can get rid of the warnings.

Regds
Rajesh Kumar Mallah.

On Tue, Oct 5, 2010 at 2:18 PM, Rob Richardson
<Rob(dot)Richardson(at)rad-con(dot)com> wrote:
> Thank you very much!  Your examples worked as you said they would work, and
> they showed that my database is logging those warnings when they happen.
> That indicates that the difference is in the Crystal Reports installation
> someplace.
>
> I don't understand how the backslashes are handled.  I added underscores to
> a couple of records in my coilstatus table, so one had "Fr_ee" and another
> had "Pack_ed".  Then, the query "SELECT status from coilstatus  where status
> like '%\\_%' limit 10;" gave me the warning that you predicted, and it found
> the two records with underscored statuses.  That tells me that the two
> backslashes cancelled each other out, and the query was the same as "SELECT
> status from coilstatus  where status like '%_%' limit 10;".  Why is that?
> Do I need to read about regular expressions?
>
> RobR
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2010-10-05 18:46:10 Re: Problem installing 9.0.1 on Windows 7 x64
Previous Message Thom Brown 2010-10-05 18:24:49 Re: PG website testing