Re: Query inside RTF

From: Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>
To: l(dot)rame(at)griensu(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query inside RTF
Date: 2009-10-08 20:01:38
Message-ID: f205bb120910081301y4370e96by85995c25d47900d6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> select
>  *
> from my_table
> where
>  cast(rtf_field as varchar) like '%condition%'
>
> This works ok when the condition doesn't include accented chars. RTF
> escapes accented characters as "\'f1" for í, "\'f3" for ó, and so on.
>
> To escape \ and ', I'd read it shuld be used \\ and '', so I thaugth
> that a like '%diagn\\\\''f3stica%' should get "diagnóstica", but it
> doesn't.
>

I prefer use

select * from table where i_bytea::text ~~ $$%\\row%$$;

Dollar quoting is more clean to put strings inside than ' '. ~~ is
like operator.
And :: operand is more clean to the syntax of the query.
Don't think so? :)

--
Emanuel Calvo Franco
DBA at: www.siu.edu.ar
www.emanuelcalvofranco.com.ar

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-10-08 20:07:25 Re: Renaming constraints
Previous Message Andreas Kalsch 2009-10-08 19:07:10 Re: Renaming constraints