@@ -61,6 +61,8 @@ Collection options:
6161 queries (default: 500)
6262 --statements-limit=LIMIT collect only utmost LIMIT number of row from
6363 pg_stat_statements (default: 100)
64+ --query-proto=PROTO which query wire protocol to use; "simple" or
65+ "extended" (default: "simple")
6466 --only-listed collect info only from the databases listed as
6567 command-line args (use with Heroku)
6668 --all-dbs collect info from all user databases
@@ -151,7 +153,8 @@ type options struct {
151153 tooLongSec uint
152154 nopager bool
153155 // connection
154- passNone bool
156+ passNone bool
157+ queryProto string
155158}
156159
157160func (o * options ) defaults () {
@@ -169,6 +172,7 @@ func (o *options) defaults() {
169172 o .nopager = false
170173 // connection
171174 o .passNone = false
175+ o .queryProto = "simple"
172176}
173177
174178func (o * options ) usage (code int ) {
@@ -234,6 +238,7 @@ func (o *options) parse() (args []string) {
234238 s .StringVarLong (& o .CollectConfig .User , "username" , 'U' , "" )
235239 s .BoolVarLong (& o .passNone , "no-password" , 'w' , "" )
236240 s .StringVarLong (& o .CollectConfig .Role , "role" , 0 , "" )
241+ s .StringVarLong (& o .queryProto , "query-proto" , 0 , "" )
237242
238243 // parse
239244 s .Parse (os .Args )
@@ -296,6 +301,13 @@ func (o *options) parse() (args []string) {
296301 os .Exit (2 )
297302 }
298303 }
304+ if o .queryProto != "simple" && o .queryProto != "extended" {
305+ fmt .Fprintln (os .Stderr , `option --query-proto must be "simple" or "extended"` )
306+ printTry ()
307+ os .Exit (2 )
308+ } else {
309+ o .CollectConfig .UseExtendedQP = o .queryProto == "extended"
310+ }
299311
300312 // help action
301313 if o .helpShort || o .help == "short" || o .help == "variables" {
0 commit comments