Re: [GENERAL] Query inside RTF

2009-10-08 Thread Alvaro Herrera
Leonardo M. Ramé escribió: > select > idturno, > infres::text > from turno > where > infres::text ~~ $$%diagn'f3stico%$$; Just make sure you don't have $$ in the search pattern ... -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Leonardo M.
On jue, 2009-10-08 at 17:51 -0300, Emanuel Calvo Franco wrote: > 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(); ) > Thanks, now this works: set stan

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Emanuel Calvo Franco
2009/10/8 Leonardo M. : > 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 charact

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Leonardo M.
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 ó,

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Emanuel Calvo Franco
> 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 th

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Sam Mason
On Thu, Oct 08, 2009 at 10:58:05AM -0300, Leonardo M. Rammm wrote: > cast(rtf_field as varchar) like '%condition%' I don't think that cast isn't doing what you expect at all. As an example, try doing something like: select cast(bytea e'hi\nbye' as varchar); encode() may be what you want ins

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Leonardo M.
On jue, 2009-10-08 at 11:28 -0400, Merlin Moncure wrote: > 2009/10/8 Leonardo M. : > > Hi, in my database I store RTF files inside a Bytea field. Now a > > customer is requesting a search inside RTF fields and I'm trying to > > implement it by issuing this query: > > > > select > > * > > from my_t

Re: [GENERAL] Query inside RTF

2009-10-08 Thread Merlin Moncure
2009/10/8 Leonardo M. : > Hi, in my database I store RTF files inside a Bytea field. Now a > customer is requesting a search inside RTF fields and I'm trying to > implement it by issuing this query: > > select >  * > from my_table > where >  cast(rtf_field as varchar) like '%condition%' > > This wo

[GENERAL] Query inside RTF

2009-10-08 Thread Leonardo M.
Hi, in my database I store RTF files inside a Bytea field. Now a customer is requesting a search inside RTF fields and I'm trying to implement it by issuing this query: select * from my_table where cast(rtf_field as varchar) like '%condition%' This works ok when the condition doesn't include