View | Details | Raw Unified | Return to bug 46575 | Differences between
and this patch

Collapse All | Expand All

(-)pykota-1.27.0.o/initscripts/postgresql/pykota-postgresql.sql (-3 / +3 lines)
 Lines 30-43    Link Here 
30
--
30
--
31
-- Create the print quota database
31
-- Create the print quota database
32
--
32
--
33
CREATE DATABASE pykota WITH ENCODING='UTF-8';
33
CREATE DATABASE pykota WITH TEMPLATE=template0 ENCODING='UTF-8';
34
34
35
--
35
--
36
-- Create the print quota database users
36
-- Create the print quota database users
37
-- NOTE: Change the password values to the passwords you would like.
37
-- NOTE: Change the password values to the passwords you would like.
38
-- 
38
-- 
39
CREATE USER pykotauser WITH UNENCRYPTED PASSWORD 'readonlypw' NOCREATEDB NOCREATEUSER;
39
CREATE USER pykotauser WITH UNENCRYPTED PASSWORD 'readonlypw' NOCREATEDB;
40
CREATE USER pykotaadmin WITH UNENCRYPTED PASSWORD 'readwritepw' NOCREATEDB NOCREATEUSER;
40
CREATE USER pykotaadmin WITH UNENCRYPTED PASSWORD 'readwritepw' NOCREATEDB;
41
41
42
-- 
42
-- 
43
-- Now connect to the new database
43
-- Now connect to the new database
(-)pykota-1.27.0.o/pykota/storages/pgstorage.py (-13 / +1 lines)
 Lines 60-69    Link Here 
60
            raise PGError, msg
60
            raise PGError, msg
61
        self.closed = 0
61
        self.closed = 0
62
        try :
62
        try :
63
            self.quote = self.database._quote
64
        except AttributeError : # pg <v4.x
65
            self.quote = pg._quote
66
        try :
67
            self.database.query("SET CLIENT_ENCODING TO 'UTF-8';")
63
            self.database.query("SET CLIENT_ENCODING TO 'UTF-8';")
68
        except PGError, msg :
64
        except PGError, msg :
69
            self.tool.logdebug("Impossible to set database client encoding to UTF-8 : %s" % msg)
65
            self.tool.logdebug("Impossible to set database client encoding to UTF-8 : %s" % msg)
 Lines 137-151    Link Here 
137
133
138
    def doQuote(self, field) :
134
    def doQuote(self, field) :
139
        """Quotes a field for use as a string in SQL queries."""
135
        """Quotes a field for use as a string in SQL queries."""
140
        if type(field) == type(0.0) :
136
        return self.database.adapter.adapt_inline(field)
141
            typ = "decimal"
142
        elif type(field) == type(0) :
143
            typ = "int"
144
        elif type(field) == type(0L) :
145
            typ = "int"
146
        else :
147
            typ = "text"
148
        return self.quote(field, typ)
149
137
150
    def prepareRawResult(self, result) :
138
    def prepareRawResult(self, result) :
151
        """Prepares a raw result by including the headers."""
139
        """Prepares a raw result by including the headers."""

Return to bug 46575