]> granicus.if.org Git - pgbouncer/commitdiff
Add paused and disabled field on the show databases command
authorMarc Cousin <marc.cousin@dalibo.com>
Tue, 24 Jan 2017 15:25:54 +0000 (16:25 +0100)
committerMarc Cousin <marc.cousin@dalibo.com>
Tue, 24 Jan 2017 15:25:54 +0000 (16:25 +0100)
src/admin.c

index 2db6d378d7592e4fb1272907ee91498658fdb7a6..cdbbaab529e84932d7e40b3c3c3ad3043b945ce9 100644 (file)
@@ -477,10 +477,10 @@ static bool admin_show_databases(PgSocket *admin, const char *arg)
                return true;
        }
 
-       pktbuf_write_RowDescription(buf, "ssissiisii",
+       pktbuf_write_RowDescription(buf, "ssissiisiiii",
                                    "name", "host", "port",
                                    "database", "force_user", "pool_size", "reserve_pool",
-                                   "pool_mode", "max_connections", "current_connections");
+                                   "pool_mode", "max_connections", "current_connections", "paused", "disabled");
        statlist_for_each(item, &database_list) {
                db = container_of(item, PgDatabase, head);
 
@@ -489,14 +489,16 @@ static bool admin_show_databases(PgSocket *admin, const char *arg)
                cv.value_p = &db->pool_mode;
                if (db->pool_mode != POOL_INHERIT)
                        pool_mode_str = cf_get_lookup(&cv);
-               pktbuf_write_DataRow(buf, "ssissiisii",
+               pktbuf_write_DataRow(buf, "ssissiisiiii",
                                     db->name, db->host, db->port,
                                     db->dbname, f_user,
                                     db->pool_size,
                                     db->res_pool_size,
                                     pool_mode_str,
                                     database_max_connections(db),
-                                    db->connection_count);
+                                    db->connection_count,
+                                    db->db_paused,
+                                    db->db_disabled);
        }
        admin_flush(admin, buf, "SHOW");
        return true;