Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsYEt-0002Ox-SV for pgsql-performance@arkaria.postgresql.org; Mon, 16 Dec 2013 13:29:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VsYEt-0007G4-4f for pgsql-performance@arkaria.postgresql.org; Mon, 16 Dec 2013 13:29:39 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsYEr-0007Fx-UW for pgsql-performance@postgresql.org; Mon, 16 Dec 2013 13:29:38 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsYEo-0001Os-GZ for pgsql-performance@postgresql.org; Mon, 16 Dec 2013 13:29:37 +0000 Received: from mfilter27-d.gandi.net (mfilter27-d.gandi.net [217.70.178.155]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id D3D9541C097; Mon, 16 Dec 2013 14:29:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter27-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter27-d.gandi.net (mfilter27-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 36TL3uvzoSxO; Mon, 16 Dec 2013 14:29:30 +0100 (CET) X-Originating-IP: 98.27.58.255 Received: from [192.168.10.146] (cpe-098-027-058-255.nc.res.rr.com [98.27.58.255]) (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 1C92041C07F; Mon, 16 Dec 2013 14:29:28 +0100 (CET) Message-ID: <52AF0037.4020909@dunslane.net> Date: Mon, 16 Dec 2013 08:29:27 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: depesz@depesz.com CC: Yuri Levinsky , "pgsql-performance@postgresql.org" Subject: Re: Current query of the PL/pgsql procedure. References: <20131216102619.GA27781@depesz.com> In-Reply-To: <20131216102619.GA27781@depesz.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) 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 On 12/16/2013 05:26 AM, hubert depesz lubaczewski wrote: > 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/ > Also, the auto-explain module can peer inside functions. See cheers andrew -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance