Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-hackers by date

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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group