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) {
3838 this . password = val ( 'password' , config ) ;
3939 this . binary = val ( 'binary' , config ) ;
4040 this . ssl = config . ssl || defaults . ssl ;
41+ this . client_encoding = config . encoding || defaults . encoding ;
4142 //a domain socket begins with '/'
4243 this . isDomainSocket = ( ! ( this . host || '' ) . indexOf ( '/' ) ) ;
4344} ;
@@ -61,7 +62,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
6162 params . push ( "host=" + this . host ) ;
6263 return cb ( null , params . join ( ' ' ) ) ;
6364 }
64- params . push ( "client_encoding='utf-8'" ) ;
65+ if ( this . client_encoding ) {
66+ params . push ( this . client_encoding ) ;
67+ }
6568 dns . lookup ( this . host , function ( err , address ) {
6669 if ( err ) return cb ( err , null ) ;
6770 params . push ( "hostaddr=" + address ) ;
Original file line number Diff line number Diff line change @@ -31,5 +31,7 @@ module.exports = {
3131 reapIntervalMillis : 1000 ,
3232
3333 //pool log function / boolean
34- poolLog : false
34+ poolLog : false ,
35+
36+ encoding : ""
3537} ;
You can’t perform that action at this time.
0 commit comments