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 1iem27-0001xY-QN for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Dec 2019 20:22:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iem25-0004Al-Tj for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Dec 2019 20:22:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iem25-0004Ad-HI for pgsql-hackers@lists.postgresql.org; Tue, 10 Dec 2019 20:22:57 +0000 Received: from mail-ua1-x944.google.com ([2607:f8b0:4864:20::944]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iem23-0003qr-0h for pgsql-hackers@postgresql.org; Tue, 10 Dec 2019 20:22:56 +0000 Received: by mail-ua1-x944.google.com with SMTP id d6so7824206uam.11 for ; Tue, 10 Dec 2019 12:22:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=HdlOBPUwLuxWxqTokOcDOpywIKtnsGIOGSLGaNjOKzU=; b=eiqzieZ/PfXVXWj1ip5WdTC7UgWYs5U6gewJ+aD/HZztYFPkyHoXGceeXRkfVAh0Nm YEy9pJo0Us+J9RxHvWBvzTWDhksA6C5a8RF85SB1kOgBeju0mncoQAaGg8yV0kiiACbm zktK/lC9V+3iLonsrO7TCpMJ7PAk4FgYwZnPuZ7KTp/z3al4iD3jdfgwFDP+w9Em4tv/ E+2yZltSogmnv1iA0eahDWXRMuCkm5TCB2Cc/i3beOC432Fq4Bj+lYsfhkH5YvEw/n7g aZQ0TelIS2E00Z5A2g/b5brYAjqMs0E0RLBh+3mpfOdTobKfXlladM4RTrorcU+++3iD Nfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=HdlOBPUwLuxWxqTokOcDOpywIKtnsGIOGSLGaNjOKzU=; b=Y6spIhaJaVcYce7DrJ0+hh7C4EEpTxoFjQecVOVCbKeZP0GxZ2tLtEsqXvwhddGnDc fn5rA2K1o8TgwbxSgJdLDcObgRxzBuahyORx99AN2JVVB/1/VPYao/fUO1SC4R8L0PZ+ AT8RMRgmEh27mVakQ5fO+/F+XnrObhTFxDQ2cWXTUGzwbiGRTYPmFu7nrAXMAzZ5p1P8 oPZcZCIumDw23OIbCoeVPikeLwPY5O+7iiFTzHMGLxUIrFEBRPUukwL6lqbM+eSimt0W 9WkO8qOjZA4ZmiUpTe6DdLa3Ksp+tU5QvKV6omrIgqlKmWgJl33rHLE8/qjLctqpnEai pqJA== X-Gm-Message-State: APjAAAV14GpOZRbTSr+KYcYEtKFOMPVtgtPgCnvUjUhHk+In8+35PeTl hm+k0oNMPPec5cPZSw99GvekeA== X-Google-Smtp-Source: APXvYqy2YcqzdiohqN470fIS4scO1tF4abAhjyyVkcPm4xfLQvQqt6r+bxK30aNbcdt3lDrwbTh2eg== X-Received: by 2002:ab0:69d4:: with SMTP id u20mr30159109uaq.1.1576009374001; Tue, 10 Dec 2019 12:22:54 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([200.73.2.58]) by smtp.gmail.com with ESMTPSA id b7sm3015451vka.2.2019.12.10.12.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 12:22:53 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 869F230057F; Tue, 10 Dec 2019 17:22:51 -0300 (-03) Date: Tue, 10 Dec 2019 17:22:51 -0300 From: Alvaro Herrera To: Tom Lane Cc: Andres Freund , Alexey Bashtanov , Peter Eisentraut , PostgreSQL Hackers Subject: Re: log bind parameter values on error Message-ID: <20191210202251.GA8361@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191210193339.GA12216@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Here's a curious thing that happens with this patch. If you have log_duration set so that parameters are logged during the bind phase, and then an error occurs during the execution phase but you don't have log_parameters_on_error set true, the second error will log the parameters nonetheless ... because they were saved in the ParamListInfo struct by the errdetail_params() call in the check_log_durations block during bind. I'm not sure this is a terrible problem, but does anybody think we *not* save params->paramValuesStr across a log_duration when log_parameters_on_error is not set? (I think this is somewhat equivalent to the "was_logged" case in check_log_duration itself.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services