-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to support pgbouncer 1.18 (#12)
* update to support pgbouncer 1.18 * adjust view formatting to reduce future changed lines in git
- Loading branch information
Showing
4 changed files
with
262 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
default_version = '0.4' | ||
default_version = '0.5' | ||
comment = 'Extension for querying pgbouncer stats from normal SQL views & running pgbouncer commands from normal SQL functions' | ||
requires = dblink | ||
relocatable = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ CREATE VIEW @[email protected]_clients AS | |
, link | ||
, remote_pid | ||
, tls | ||
, application_name | ||
FROM dblink('pgbouncer', 'show clients') AS x | ||
( type text | ||
, "user" text | ||
|
@@ -33,7 +34,9 @@ CREATE VIEW @[email protected]_clients AS | |
, ptr text | ||
, link text | ||
, remote_pid int | ||
, tls text); | ||
, tls text | ||
, application_name text | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_config AS | ||
|
@@ -45,7 +48,8 @@ CREATE VIEW @[email protected]_config AS | |
( key text | ||
, value text | ||
, "default" text | ||
, changeable boolean); | ||
, changeable boolean | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_databases AS | ||
|
@@ -75,7 +79,8 @@ CREATE VIEW @[email protected]_databases AS | |
, max_connections int | ||
, current_connections int | ||
, paused int | ||
, disabled int); | ||
, disabled int | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_dns_hosts AS | ||
|
@@ -85,7 +90,8 @@ CREATE VIEW @[email protected]_dns_hosts AS | |
FROM dblink('pgbouncer', 'show dns_hosts') AS x | ||
( hostname text | ||
, ttl bigint | ||
, addrs text); | ||
, addrs text | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_dns_zones AS | ||
|
@@ -95,24 +101,29 @@ CREATE VIEW @[email protected]_dns_zones AS | |
FROM dblink('pgbouncer', 'show dns_zones') AS x | ||
( zonename text | ||
, serial text | ||
, count int); | ||
, count int | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_lists AS | ||
SELECT list | ||
, items | ||
FROM dblink('pgbouncer', 'show lists') AS x | ||
( list text | ||
, items int); | ||
, items int | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_pools AS | ||
SELECT database | ||
, "user" | ||
, cl_active | ||
, cl_waiting | ||
, cl_cancel_req | ||
, cl_active_cancel_req | ||
, cl_waiting_cancel_req | ||
, sv_active | ||
, sv_active_cancel | ||
, sv_being_canceled | ||
, sv_idle | ||
, sv_used | ||
, sv_tested | ||
|
@@ -125,15 +136,19 @@ CREATE VIEW @[email protected]_pools AS | |
, "user" text | ||
, cl_active int | ||
, cl_waiting int | ||
, cl_cancel_req int | ||
, cl_active_cancel_req int | ||
, cl_waiting_cancel_req int | ||
, sv_active int | ||
, sv_active_cancel int | ||
, sv_being_canceled int | ||
, sv_idle int | ||
, sv_used int | ||
, sv_tested int | ||
, sv_login int | ||
, maxwait int | ||
, maxwait_us int | ||
, pool_mode text); | ||
, pool_mode text | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_servers AS | ||
|
@@ -154,6 +169,7 @@ CREATE VIEW @[email protected]_servers AS | |
, link | ||
, remote_pid | ||
, tls | ||
, application_name | ||
FROM dblink('pgbouncer', 'show servers') AS x | ||
( type text | ||
, "user" text | ||
|
@@ -171,7 +187,9 @@ CREATE VIEW @[email protected]_servers AS | |
, ptr text | ||
, link text | ||
, remote_pid int | ||
, tls text); | ||
, tls text | ||
, application_name text | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_sockets AS | ||
|
@@ -192,6 +210,7 @@ CREATE VIEW @[email protected]_sockets AS | |
, link | ||
, remote_pid | ||
, tls | ||
, application_name | ||
, recv_pos | ||
, pkt_pos | ||
, pkt_remain | ||
|
@@ -217,13 +236,15 @@ CREATE VIEW @[email protected]_sockets AS | |
, link text | ||
, remote_pid int | ||
, tls text | ||
, application_name text | ||
, recv_pos int | ||
, pkt_pos int | ||
, pkt_remain int | ||
, send_pos int | ||
, send_remain int | ||
, pkt_avail int | ||
, send_avail int); | ||
, send_avail int | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_stats AS | ||
|
@@ -257,12 +278,14 @@ CREATE VIEW @[email protected]_stats AS | |
, avg_sent bigint | ||
, avg_xact_time bigint | ||
, avg_query_time bigint | ||
, avg_wait_time bigint ); | ||
, avg_wait_time bigint | ||
); | ||
|
||
|
||
CREATE VIEW @[email protected]_users AS | ||
SELECT name | ||
, pool_mode | ||
FROM dblink('pgbouncer', 'show users') AS x | ||
( name text | ||
, pool_mode text); | ||
, pool_mode text | ||
); |
Oops, something went wrong.