Search Postgresql Archives

Re: Query inside RTF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/10/8 Leonardo M. <l.rame@xxxxxxxxxxx>:
> On jue, 2009-10-08 at 17:01 -0300, Emanuel Calvo Franco wrote:
>> > 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? :)
>
> It looks nice!, the only problem is I'm still forced to set
> standard_conforming_strings = 1;
>
>

part=# set standard_conforming_strings = 0;
SET
part=# select * from p  where i::text ~~ $$%\\\\f3%$$;
   i
--------
 \\\\f3
 \\\\f3
(2 rows)

part=# select * from p  where i::text ~~ $$%\\\\"f3%$$;
    i
---------
 \\\\"f3
(1 row)

part=# select * from p  where i::text ~~ $$%\\\\''f3%$$;
    i
----------
 \\\\''f3
(1 row)

I don't have any problem, wich enconding you are using?
(select getdatabaseencoding(); )



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux