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 1iSq3u-0002r7-Bc for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2019 22:15:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSq3s-00076n-S6 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2019 22:15:28 +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 1iSq3s-00076T-Is for pgsql-hackers@lists.postgresql.org; Thu, 07 Nov 2019 22:15:28 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSq3p-00057u-Oi for pgsql-hackers@postgresql.org; Thu, 07 Nov 2019 22:15:28 +0000 Received: by mail-qv1-xf43.google.com with SMTP id y18so1478415qve.2 for ; Thu, 07 Nov 2019 14:15:25 -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=VPAdFCbKeto/UcDAtRgODH18ZX6KTKT9OlCTE+JDL1Y=; b=HtsQ5vylMwdh0HKfE99NUs0uIAuT53y1WPHc7gKIhTn6XOkuBl/9AUi8dtmrAeGI8S ZGD+UqFOwHBmpvvE98r5fcuMMn8j16HQgBAgfzWtBPDYaKiA8N5atv4WEo4VHMtSAMRa ewQLCCpBSFurrE7uuwU5fJ/EaXVVBE1c5hONB5TI6AtafyGphU13PPr+zJOitvWh+fhc qvm7iQYxX6NDuWghWdfAZ93hAz78QEqJNQ11nBGZ4cbzSRfoi7iDWajVSaU5u6Z1blWQ ZFobYeSLhV9NUbaJuuxNL8lxkhZ5KC5hRtYM+XMALt+O2LJFOy6aZfYKeVV44rWxt/Av Pttw== 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=VPAdFCbKeto/UcDAtRgODH18ZX6KTKT9OlCTE+JDL1Y=; b=nspeGIYmEH2wC1chDLdXwwNBGYS9CFEMafWppA8ptI/mYVGuR3/xo+lXoB2GiAK99M cJtsEvP9UxZiEil178YdxVjq37cWR/y/1nxjU26P2Wdsnkp3Grz+b3iKlEBVpgr1lC/p E+xM2+YRsqFrvjNAd2cgwIQS24T++PSb6+vgrn9kQhNYtG3r79lNCGIQjmtw211VkcLv Zo4v34zFVO1CSLCp3xyen+kerHxp4LOY3xFROSCEQOqHvS6Pm/QfV8ekIa+Z3HVRHlyT pceZsQSlBm5vbVZnwu7WR9jLrI6Mral+VAO1U6HSeNe26z1qrOez40cvIan8sd8sfOmb b0FA== X-Gm-Message-State: APjAAAVQnBKzWiplPhgRtUbPVZaDdRFlFK8EXtTuERUrTOQN4nGWHL23 /DONglplEohG5UtyOuMmlhk65Hl1fOKFoQ== X-Google-Smtp-Source: APXvYqzUVvbBNdCYXAjKBL5dZebpXtF7aFYbLEcf7Z3GpDt/i0y79oRVqGbVoHX/CP2Lvm8h1Y0EvQ== X-Received: by 2002:ad4:43e9:: with SMTP id f9mr6199813qvu.66.1573164923373; Thu, 07 Nov 2019 14:15:23 -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 m13sm1750468qka.109.2019.11.07.14.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 14:15:22 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id B0493302464; Thu, 7 Nov 2019 19:15:19 -0300 (-03) Date: Thu, 7 Nov 2019 19:15:19 -0300 From: Alvaro Herrera To: Alexey Bashtanov Cc: Andres Freund , Peter Eisentraut , PostgreSQL Hackers Subject: Re: log bind parameter values on error Message-ID: <20191107221519.GA9543@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191107220228.GA8765@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 On 2019-Nov-07, Alvaro Herrera wrote: > 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. (BTW it looks like plpgsql_param_fetch() is creating ParamExternData values and not setting textValue for them.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services