zdzieblo has asked for the wisdom of the Perl Monks concerning the following question:
in my previous node
we decided that for the queries like this: my $sql = "SELECT a FROM table WHERE (a ~* (E\'.*\' || ?))";quotemeta is enough to stop users sneaking in reg expression into the queries. and it probably is.
unfortunately quotemeta also quotes unicode characters what makes the situation unacceptable in majority cases:
DBD::Pg::st execute failed: ERROR: invalid byte sequence for encoding + "UTF8": 0xd05c HINT: This error can also happen if the byte sequence does not match +the encoding expected by the server, which is controlled by "client_e +ncoding". at
thus i think we need to come up with a better resolution.. ;-)
thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: postgres reg expression quoting (again)
by almut (Canon) on Apr 06, 2009 at 19:45 UTC | |
|
Re: postgres reg expression quoting (again)
by ikegami (Patriarch) on Apr 06, 2009 at 19:50 UTC | |
by zdzieblo (Acolyte) on Apr 06, 2009 at 23:45 UTC |