Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsVNb-0004ML-Lx for pgsql-performance@arkaria.postgresql.org; Mon, 16 Dec 2013 10:26:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VsVNb-00073Q-13 for pgsql-performance@arkaria.postgresql.org; Mon, 16 Dec 2013 10:26:27 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsVNZ-00073J-OA for pgsql-performance@postgresql.org; Mon, 16 Dec 2013 10:26:25 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsVNW-0006Vc-Cj for pgsql-performance@postgresql.org; Mon, 16 Dec 2013 10:26:25 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.82) (envelope-from ) id 1VsVNT-0000uw-Vw; Mon, 16 Dec 2013 11:26:20 +0100 Date: Mon, 16 Dec 2013 11:26:19 +0100 From: hubert depesz lubaczewski To: Yuri Levinsky Cc: "pgsql-performance@postgresql.org" Subject: Re: Current query of the PL/pgsql procedure. Message-ID: <20131216102619.GA27781@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Sun, Dec 15, 2013 at 04:18:18PM +0000, Yuri Levinsky wrote: > Dear ALL, > I am running PL/pgsql procedure with sql statements that taking a long > time. I able to see them in the log just after their completion. How > can I see currently running SQL statement? I am able to see in > pg_stat_activity only my call to function. Many thanks in advance. pg_stat_activity and pg logs, can't see what your function does internally. What you can do, though, is to add some "RAISE LOG" to the function, so that it will log its progress. Check this for example: http://www.depesz.com/2010/03/18/profiling-stored-proceduresfunctions/ Best regards, depesz --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJSrtUyAAoJEH8YKMd1okYDK/QP/1HuaBQYmSnm9xMJ2ejRVJzD K5PG3eFO77n3uC/nySQyAt3+urm1YCPRzeSRo0/Wsnf/LeYm4aR4esC89Pw1BDwi SGC7ew/YfMThfEbRxQGjm4fXo/sKOAgj867z7hyp8dmLyRUnbzsmDjGReo0xcOvz 0fr54ITTa280myPBczs+dGJkKNhrw+MJqWRNMQ2SaNPd0wHRcXJF4LZRwh+a2PHp cKi/OCsJTEp+kRa04RxBz+hKsgfqpkdqpfBeJNfKan6L94dwdAJcgqP6q1LmQqgg VAkfwdUGT7OaGnFr/jrmUAEFQf6DDDbFsH+1hSk6oOeN0PnyYZLx+dsBs4kRow2b rM8+YZ+7noj0vz2wzVf6eNsrh+PhJgs19iu6jInEW6K07ZIUsUhmq0xkAsmDR8cP GOnpPDxmbAoSxNcL8IYHF58US3YsbJ9ZzC4HEANBdIAx3TBIiHJoIjtaOWDofr3J iw5s5e/gGNAq3QaR43vaO0nMGwSFD/EnvSvU0JnRtAJlVP23zLtR7ujR9TzLBHgq CboORVqgb0LiyWjhs7AgjSnliPrufsIUpnrMYmL8ZKGV9Amcr0mNPYO3jYFd+RLn NoEBMh3xcxw2+XDTw6uv/IJR2PCwr3yKM+TeZK1or/pwflWCy+GkCXHwHjPN5xpE F2BrHKd44KVihDA1pqK1 =vdMc -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--