Search Postgresql Archives

plperl and regexps with accented characters - incompatible?

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

 



hi,
i wrote this function:
#v+
CREATE OR REPLACE FUNCTION test(TEXT) RETURNS bool language plperl as $$
return (shift =~ /[a-ząćęłńóśźżĄĆĘŁŃŚÓŹŻ0-9_-]+/i) || 0;
$$;
#v-

it's functioning it not really relevant.

important thing is, that the creation of it fails:
psql:z.sql:25: ERROR:  creation of Perl function "texts_words_iu" failed:
'require' trapped by operation mask at line 15.

it looks strange - what "require"?

i mean - it is possible that perl itself loads something that is related to handling polish characters.

if i'll remove "i" flag to regexp matching - it works ok. 
so, i assume perl loads something like "locale" or "utf8" modules to handle
//i, but since the error message doesn't mention what module it tried to load
it is quite hard to understand it.
also - perhaps loading of this particular module should be allowed even in
plperl? otherwise it requires me to use plperlu for even the simple task of
regexp matching.

if i'll remove //i flag - it works correctly, but then i have to change "a-z" to "a-zA-Z", and it's not really nice.

any ideas what's wrong, and how can i fix it?

depesz

-- 
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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