@@ -173,6 +173,21 @@ UNION ALL SELECT
173173 NULL ::int AS client_port
174174LIMIT 1 ;
175175
176+ [startup_data_92:transient:first]
177+ -- 9.2 and greater
178+ SELECT
179+ pg_catalog .version ()::text AS version,
180+ backend_start::text ,
181+ client_addr::text ,
182+ client_port::int
183+ FROM pg_catalog .pg_stat_activity WHERE pid = pg_catalog .pg_backend_pid ()
184+ UNION ALL SELECT
185+ pg_catalog .version ()::text AS version,
186+ NULL ::text AS backend_start,
187+ NULL ::text AS client_addr,
188+ NULL ::int AS client_port
189+ LIMIT 1 ;
190+
176191[startup_data_no_start:transient:first]
177192-- 8.1 only, but is unused as often the backend's activity row is not
178193-- immediately present.
@@ -200,6 +215,15 @@ FROM
200215WHERE
201216 procpid != pg_catalog .pg_backend_pid ()
202217
218+ [terminate_backends_92:transient:column]
219+ -- Terminate all except mine. 9.2 and later
220+ SELECT
221+ pid, pg_catalog .pg_terminate_backend (pid)
222+ FROM
223+ pg_catalog .pg_stat_activity
224+ WHERE
225+ pid != pg_catalog .pg_backend_pid ()
226+
203227[cancel_backends:transient:column]
204228-- Cancel all except mine.
205229SELECT
@@ -209,6 +233,15 @@ FROM
209233WHERE
210234 procpid != pg_catalog .pg_backend_pid ()
211235
236+ [cancel_backends_92:transient:column]
237+ -- Cancel all except mine. 9.2 and later
238+ SELECT
239+ pid, pg_catalog .pg_cancel_backend (pid)
240+ FROM
241+ pg_catalog .pg_stat_activity
242+ WHERE
243+ pid != pg_catalog .pg_backend_pid ()
244+
212245[sizeof_db:transient:first]
213246SELECT pg_catalog .pg_database_size (current_database())::bigint
214247
0 commit comments