My apologies. I didn't look at the expression closely enough and jumped to the wrong conclusion. I have a better understanding of it now.
If you're expecting the user to provide text to match literally (as opposed to a regular expression pattern), then you need to convert the text into a regular expression pattern. In Perl, quotemeta would do. It will probably do for your database as well.
my $input = '['; $sth->execute(quotemeta($input));
In reply to Re^5: postgres reg expression quoting
by ikegami
in thread postgres reg expression quoting
by zdzieblo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |