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 1ieO8J-0004py-5z for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2019 18:51:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ieO8H-0003bL-UQ for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2019 18:51:45 +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 1ieO8H-0003bE-Hq for pgsql-hackers@lists.postgresql.org; Mon, 09 Dec 2019 18:51:45 +0000 Received: from mail-ua1-x941.google.com ([2607:f8b0:4864:20::941]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ieO8F-0008TX-54 for pgsql-hackers@postgresql.org; Mon, 09 Dec 2019 18:51:44 +0000 Received: by mail-ua1-x941.google.com with SMTP id q22so2403164uam.6 for ; Mon, 09 Dec 2019 10:51:42 -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=q8Q0jytij0TisXPuuOr7zhEAUSSQiQ2VUJ2IO/mUpok=; b=z651Osacdpw9oK1I3zfdlBg9aiKE0aY1OLL6D0F+Xfrhf+E5wfIqCYKUC2eyP6AUBw R73M/PgRTBTUQvrHVj4QBIs/1ZMto/ng5F+IL2+qFh7GiQLLR2IFr/vfuRKlCQMKbx2I 7WLT0LY4LLWsbI1dP14FKUcef1jcr6/74R+IDUee7SLzNZiXc6fJyoOhEwo+kmC19ZJT R+wVS8MGIEf7QB4p5oVE0H2kIVhwF3xHXcTf3T33jQaFy7fiJ5Hr7pANFlw9WMI+jVXR ST9RB+OYsw8hPzu/g/F14wugQutwPGAvI4MUvRUKkd+ONGOR2H8MaCVx6VMrJ4lH0C/M H07g== 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=q8Q0jytij0TisXPuuOr7zhEAUSSQiQ2VUJ2IO/mUpok=; b=SAvShdEycVxONOKv0XIk84tBtSlUL7aStICq1JFyUpgzpyKrG2hlise6SKl7o+lfIo uM3VdrVDtHn3ndLNIqoR8wdwRQHOHLusdwg0i5i1Q0QbXKeNA77SF8nJB5GlKWfCB2Sl PWoNJ/btTru5fda+l/+loBXKLaJIsdjOra0V7rBhDT0Gct3NYvw5KmeO84F8wJFP2zlY OOHEIyLEglSBVnyijYf1EQVryb44yIcUZWRZjrWcnV01y30eVQaGc42NZ6DZbKcRxLwg 0EPxR3W6WOex4cY3rCpy1yZcAHCCbHNBz7SuEKeo1/GsIpuP8//Fh2c3BMuaJiNR5jg1 RDgA== X-Gm-Message-State: APjAAAVV5Kb+cJI+IfctHy9tGVf4UeouZopNSXPEd0Fw/WYoZOsM401a 84GdUnSclW8Y8Tsf0NER4b2bMaenqxra2A== X-Google-Smtp-Source: APXvYqwVTAVuDQBa0o4ZW8wvx4gZJxJUDifggFci60FwFolj0hc03cEk6yOIG8itjXiLCJVepco2YA== X-Received: by 2002:ab0:2716:: with SMTP id s22mr25533393uao.20.1575917502177; Mon, 09 Dec 2019 10:51:42 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.217.182.133]) by smtp.gmail.com with ESMTPSA id 140sm595047vkc.3.2019.12.09.10.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 10:51:41 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 77E76300832; Mon, 9 Dec 2019 15:51:38 -0300 (-03) Date: Mon, 9 Dec 2019 15:51:38 -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: <20191209185138.GA10459@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <30654.1575913347@sss.pgh.pa.us> 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-Dec-09, Tom Lane wrote: > I wrote: > > Alvaro Herrera writes: > >> 1. change enough of the build system so that pg_encoding_mbcliplen is > >> available. (Offhand I see no reason why we couldn't move the > >> function from mbutils.c to wchar.c, but I haven't tried.) > > > I'd be in favor of this if it doesn't turn out to require nasty > > contortions. My gut feeling (like yours, without having looked) is that > > the incremental amount of code to be moved into wchar.c wouldn't be much. > > Actually, on second thought --- the issue here is not so much how much new > code shows up in libpgcommon, and more that executables using stringinfo.o > will now find themselves pulling in all of wchar.o, where before they > might've pulled in none of it. We need to look at how much code bloat > ensues. In the end it might be smart to put this new functionality in > some separate source file instead of dropping it into stringinfo.c. > (It could also be that all the executables that need stringinfo.o are > already pulling in wchar functionality for other reasons, but we should > check the code-size implications before assuming this is fine.) Hmm, that's a good thought. On the one hand, nothing in the frontend needs this new function ... the only current use is pg_waldump which likely doesn't need to quote anything, and I just looked at Andres' programmatically- written node support code which is why we have StringInfo in frontend in the first place -- it also doesn't care. So rather than mess with stringinfo.c at all I could just create stringinfo_server.c and put this function there, compiled only for backend ... -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services