Re: BUG #2683: spi_exec_query in plperl returns column names which are not marked as UTF8

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Vitali Stupin" <Vitali(dot)Stupin(at)ria(dot)ee>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: BUG #2683: spi_exec_query in plperl returns column names which are not marked as UTF8
Date: 2006-10-15 01:55:10
Message-ID: 14224.1160877310@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

"Vitali Stupin" <Vitali(dot)Stupin(at)ria(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Greg Sabino Mullane 2006-10-15 17:34:21 Re: BUG #2683: spi_exec_query in plperl returns column names which are not marked as UTF8
Previous Message Tom Lane 2006-10-13 20:43:33 Re: BUG #2691: Server did not start. Error: Could not create log file.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-10-15 03:10:21 Re: [HACKERS] large object regression tests
Previous Message Sean Davis 2006-10-15 00:00:31 Re: Problems building 8.2beta1 on macos G5 xserve