Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0puM-0008Bt-0U for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Mar 2019 15:53:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h0puJ-0001JS-TG for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Mar 2019 15:53:35 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0puJ-0001JK-DU for pgsql-hackers@lists.postgresql.org; Mon, 04 Mar 2019 15:53:35 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h0puG-0000GC-SK for pgsql-hackers@postgresql.org; Mon, 04 Mar 2019 15:53:35 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id AC74F21C826D; Mon, 4 Mar 2019 18:53:31 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 7467821C823D; Mon, 4 Mar 2019 18:53:31 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1551714811; bh=j/2c5PHfyijmw6i2Lns0kKZnt6WBxJTDjwRG/6pCdAE=; h=Subject:To:References:From:Date:In-Reply-To; b=bssvX4tJvvBZCD+3NpY8lWIslFaSox5OfKJDQqSeWrPqRsnqT/481mNcqL2qzSpbo mAdDVsOgXjKurHh+jetyzwlf7dzJKS+STYRVwhKQ+ts/rZPCQLgYrsKYb8daDYm5Fa eR0oluTTC0VkqYPcWEIpclW+J61RwClZ6AVaHqCU= Subject: Re: query logging of prepared statements To: Justin Pryzby , pgsql-hackers@postgresql.org References: <20190208132953.GF29720@telsasoft.com> <20190215145704.GW30291@telsasoft.com> <20190227180653.GF28750@telsasoft.com> From: Arthur Zakirov Message-ID: <70868e0d-2a29-36c8-e3e2-f54a56804bc4@postgrespro.ru> Date: Mon, 4 Mar 2019 18:53:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190227180653.GF28750@telsasoft.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Justin, On 27.02.2019 21:06, Justin Pryzby wrote: > I'm attaching a v2 patch which avoids repeated logging of PREPARE, rather than > making such logs conditional on log_error_verbosity=VERBOSE, since > log_error_verbosity is documented to control whether these are output: > DETAIL/HINT/QUERY/CONTEXT/SQLSTATE. I looked the patch. I got interesting result with different parameters. With log_statement='all' and log_min_duration_statement='0' I get: =# execute test_ins(3); LOG: statement: execute test_ins(3); LOG: duration: 17.283 ms But with log_statement='none' and log_min_duration_statement='0' I get: =# execute test_ins(3); LOG: duration: 8.439 ms statement: execute test_ins(3); DETAIL: prepare: prepare test_ins (int) as insert into test values ($1); Is it intended? In the second result I got the query details. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company