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

BUG #4158: client encoding is wrong in plpythonu code

From: "Andriy Rysin" <arysin(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4158: client encoding is wrong in plpythonu code
Date: 2008-05-11 17:25:24
Message-ID: 200805111725.m4BHPOeA075979@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4158
Logged by:          Andriy Rysin
Email address:      arysin(at)gmail(dot)com
PostgreSQL version: 8.3.1
Operating system:   Linux (Mandriva 2008.1) x86_64
Description:        client encoding is wrong in plpythonu code
Details: 

$ more test.py
set client_encoding = 'UTF8';

CREATE OR REPLACE FUNCTION test_encoding()
RETURNS varchar AS $$
    import sys

    return sys.getdefaultencoding() + ', can change: ' + str( hasattr(sys,
'setdefaultencoding') )

$$ LANGUAGE plpythonu;

show client_encoding;
select test_encoding();

$ psql krym -f test.py
SET
CREATE FUNCTION
 client_encoding
-----------------
 UTF8
(1 row)

      test_encoding
--------------------------
 ascii, can change: False
(1 row)

pgsql-bugs by date

Next:From: srinivasuluDate: 2008-05-12 11:07:54
Subject: BUG #4160: I get this error
Previous:From: Tom LaneDate: 2008-05-10 20:57:48
Subject: Re: statement_timeout and crosstab

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