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 1iSprR-0002Kt-8V for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2019 22:02:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSprP-0007cb-SN for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2019 22:02:35 +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 1iSprP-0007cU-Gk for pgsql-hackers@lists.postgresql.org; Thu, 07 Nov 2019 22:02:35 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iSprN-00083r-8c for pgsql-hackers@postgresql.org; Thu, 07 Nov 2019 22:02:34 +0000 Received: by mail-qk1-x743.google.com with SMTP id h15so3442527qka.13 for ; Thu, 07 Nov 2019 14:02:33 -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=xrQqn5jY9aECXzgUlal1k3kfA43eh2nZeOvjIAOKCrM=; b=2IxIpTW65W/hmipmG6WmzLMbSNpfo6rihxtL4xzziGxJ5Zz0rF8kFwrw1FW5FIFV6U D1xZ4w9it9WMoMvmss79Txj85musoCTC1AYG3QDwMQ6nHt9Hvwpn6OoZPQkxw6SHkzBg vnWP4Kb5STKTsS7mDeAU3H47ydVu0xLSrJRc2YfyFGWgec4IQz+DMny9kfRpwKmPISeU Dtp8pxFvr3b06eT4YfPNJFNbkUn4absI7bwvHUnJP20jfefMKGemCc9NZQzzKg2HePbw dXR4xyOOPyw/5NiZNn7JrHM9jWc6y2Yl+m8uRAs+8hJd2E39GviJjJ5QZu6I61eHBQaJ ZhOA== 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=xrQqn5jY9aECXzgUlal1k3kfA43eh2nZeOvjIAOKCrM=; b=FKRV2ITLUYrO0Yo5IwE6P4H+jw+QQzn9UHR2Ipic2q40eiaTgrfYgudor1tGnsz0ml /wfipzxmHtSRTVNNyZNLBHORupXi9XWHen25XnfVxvhedF7pbsaQ9J6BV1jcDxajqc53 VUYL2X7IXI5TKZVhnvc+0q0r9Iw1Z8m+iGsCdyEvXwXFW/AGfurUuJVCeoAgc8eycucI gPFv70SXsvBJLTMhnTtIyr8xsgdsX3p3xCiMATed0QYLKwo6L4RxjQmYXYlQzxJ+eyUf k5XBaYvoSbbcP/CopXz+TCvDFqAiokWQPTni3kg51VtB3rw4SN66cRC29kUeniMQwEQP jZyA== X-Gm-Message-State: APjAAAUqdP3uG7DhPRY7okS+0XArnBkGfAhb5ODt2wnGvEw7n11O+UuT ZNRqIRKuKHLGiY9QACMMrGFHfg== X-Google-Smtp-Source: APXvYqwGLlCuv7Bf5xlJJxenmcnS4tFWQ12iVsaZAn7o/zCHpx5/nMmx44bAcfRQCFNLp9ho0mJuIA== X-Received: by 2002:a37:ea19:: with SMTP id t25mr5381140qkj.340.1573164152150; Thu, 07 Nov 2019 14:02:32 -0800 (PST) Received: from nimloth.alvh.no-ip.org (ip-57-2-52-196.nyc.us.northamericancoax.com. [196.52.2.57]) by smtp.gmail.com with ESMTPSA id c20sm2345922qtc.13.2019.11.07.14.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 14:02:31 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 49429302464; Thu, 7 Nov 2019 19:02:28 -0300 (-03) Date: Thu, 7 Nov 2019 19:02:28 -0300 From: Alvaro Herrera To: Alexey Bashtanov Cc: Andres Freund , Peter Eisentraut , PostgreSQL Hackers Subject: Re: log bind parameter values on error Message-ID: <20191107220228.GA8765@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4e374af0-5a2b-73fa-3dfe-d180fcd2ee3e@imap.cc> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk So, if some parameters are large (they can be up to 1 GB-1, remember) then we can bloat the log file severely. I think we need to place an upper limit on the strings that we're going to log -- as inspiration, callers of ExecBuildValueDescription uses 64 chars per value maximum. Something like that seems reasonable. So I think you need to add some pg_mbcliplen() calls in a couple of places in exec_bind_message. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services