Re: [BUGS] BUG #2683: spi_exec_query in plperl returns column names which are not marked as UTF8 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] BUG #2683: spi_exec_query in plperl returns column names which are not marked as UTF8
Date
Msg-id 14224.1160877310@sss.pgh.pa.us
Whole thread Raw
Responses Re: [BUGS] BUG #2683: spi_exec_query in plperl returns column names which are not marked as UTF8  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Vitali Stupin" <Vitali.Stupin@ria.ee> writes:
> If database uses UTF8 encoding, then spi_exec_query in plperl should return
> query results in UTF8 encoding. But unfortunately only data is marked as
> UTF8, while column names are not.

It looks to me like basically everywhere in plperl.c that does newSVpv()
should follow it with

#if PERL_BCDVERSION >= 0x5006000L           if (GetDatabaseEncoding() == PG_UTF8)               SvUTF8_on(sv);
#endif

whereas currently there are only a couple of places that do that.

I'm tempted to consolidate this into a function on the order of
newSVstring(const char *) or some such.  Comments?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Sean Davis
Date:
Subject: Re: Problems building 8.2beta1 on macos G5 xserve
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] large object regression tests