Okay, so habe ich es jetzt definiert.
Das geht auch mit "SELECT * FROM dba.fct_connections()".
-- Function: dba.fct_connections()
-- DROP FUNCTION dba.fct_connections();
CREATE OR REPLACE FUNCTION dba.fct_connections(OUT duration double precision, OUT connections bigint)
RETURNS record AS
$BODY$SELECT EXTRACT(EPOCH FROM max(now() - xact_start)) AS duration, count(*) AS connections
FROM pg_catalog.pg_stat_activity$BODY$
LANGUAGE sql VOLATILE SECURITY DEFINER
COST 100;
ALTER FUNCTION dba.fct_connections() OWNER TO postgres;



LinkBack URL
About LinkBacks
Zitieren
Lesezeichen