Re: Initial refactoring of plperl.c - rebased [PATCH] - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Initial refactoring of plperl.c - rebased [PATCH]
Date
Msg-id 4B427BDB.8010404@dunslane.net
Whole thread Raw
In response to Re: Initial refactoring of plperl.c - rebased [PATCH]  (Andrew Dunstan <andrew@dunslane.net>)
Responses Initial refactoring of plperl.c - updated  (Tim Bunce <Tim.Bunce@pobox.com>)
List pgsql-hackers

Andrew Dunstan wrote:
>>
>> Yes. I believe the test is highlighting an existing problem: that plperl
>> function in non-PG_UTF8 databases can't use regular expressions that
>> require unicode character meta-data.
>>
>> Either the (GetDatabaseEncoding() == PG_UTF8) test in plperl_safe_init()
>> should be removed, so the utf8fix function is always called, or the
>> test should be removed (or hacked to only apply to PG_UTF8 databases).
>>   
>
>
> I tried forcing the test, but it doesn't seem to work, possibly 
> because in the case that the db is not utf8 we aren't forcing argument 
> strings to UTF8 :-(
>
> I think we might need to remove the test from the patch.
>
>

I have not been able to come up with a fix for this - the whole thing 
seems very fragile. I'm going to commit what remains of this patch, but 
not add the extra regression test. I'll add a TODO to allow plperl to do 
utf8 operations in non-utf8 databases.

cheers

andrew


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Testing with concurrent sessions
Next
From: "David E. Wheeler"
Date:
Subject: Re: Testing with concurrent sessions