I am having problems matching a pattern from log files I am analyzing on a Postgres 8.3 instance.
The patterns I am trying to match are
cs(User-Agent)=-
cs(Referer)=-
I have tried both the like and the ~ operator with the escapes below but no luck so far:
select * from database
where ~ E'\(Referer\)\=\-';
select * from database
where like 'cs\(User\-Agent\=\-)';
What am I doing wrong?
Notice the choice of a column from which the data you are analyzing is drawn, and the percent signs (wildcards), indicating that you want to find the string anywhere in the field. Without the wildcards, you won’t match anything.