File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ var ConnectionParameters = function(config) {
38
38
this . password = val ( 'password' , config ) ;
39
39
this . binary = val ( 'binary' , config ) ;
40
40
this . ssl = config . ssl || defaults . ssl ;
41
+ this . client_encoding = config . encoding || defaults . encoding ;
41
42
//a domain socket begins with '/'
42
43
this . isDomainSocket = ( ! ( this . host || '' ) . indexOf ( '/' ) ) ;
43
44
} ;
@@ -61,7 +62,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
61
62
params . push ( "host=" + this . host ) ;
62
63
return cb ( null , params . join ( ' ' ) ) ;
63
64
}
64
- params . push ( "client_encoding='utf-8'" ) ;
65
+ if ( this . client_encoding ) {
66
+ params . push ( this . client_encoding ) ;
67
+ }
65
68
dns . lookup ( this . host , function ( err , address ) {
66
69
if ( err ) return cb ( err , null ) ;
67
70
params . push ( "hostaddr=" + address ) ;
Original file line number Diff line number Diff line change @@ -31,5 +31,7 @@ module.exports = {
31
31
reapIntervalMillis : 1000 ,
32
32
33
33
//pool log function / boolean
34
- poolLog : false
34
+ poolLog : false ,
35
+
36
+ encoding : ""
35
37
} ;
You can’t perform that action at this time.
0 commit comments