Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fCWHw-0004XB-1H for pgsql-general@arkaria.postgresql.org; Sat, 28 Apr 2018 20:17:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fCWHu-0003Gj-Ia for pgsql-general@arkaria.postgresql.org; Sat, 28 Apr 2018 20:17:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fCWHu-0003GZ-AB for pgsql-general@lists.postgresql.org; Sat, 28 Apr 2018 20:17:42 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fCWHq-0005aG-L8 for pgsql-general@postgresql.org; Sat, 28 Apr 2018 20:17:41 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 3E8A0C9DA94D for ; Sat, 28 Apr 2018 13:17:36 -0700 (MST) Date: Sat, 28 Apr 2018 13:17:36 -0700 (MST) From: legrand legrand To: pgsql-general@postgresql.org Message-ID: <1524946656214-0.post@n3.nabble.com> In-Reply-To: <20180427114503.GA12829@zakirov.localdomain> References: <1524774265469-0.post@n3.nabble.com> <20180427114503.GA12829@zakirov.localdomain> Subject: Re: pg_stat_statements : how to catch non successfully finished statements ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk OK I see ... This hook should be used only for ERROR (no WARNING nor NOTICE ...) and the only real interesting information is ErrorData -> internalquery; /* text of internally-generated query */ This doesn't permit to (re)build the link to queryid (that is based on parse tree, but not available here) So the only solution is to had queryId to ErrorData in this hook or create a new hook fired on ERROR and containing queryId ? Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html