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 1gV0lP-0002LC-GZ for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Dec 2018 21:00:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gV0lO-0001f9-0V for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Dec 2018 21:00:50 +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 1gV0lN-0001es-NJ for pgsql-bugs@lists.postgresql.org; Thu, 06 Dec 2018 21:00:49 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gV0lK-0004YF-4B for pgsql-bugs@lists.postgresql.org; Thu, 06 Dec 2018 21:00:48 +0000 Received: by mail-qt1-x844.google.com with SMTP id z16so2187173qtq.4 for ; Thu, 06 Dec 2018 13:00:45 -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=zUi+fS/jJjPBgMwUjWq0k0AcHFJfaauXZ2+Du6n7l1Y=; b=Xn1LExSHWXwH5GxI++rtb6xWF3tCyGFW/YmLDEj6IXn5Vbq6b2pQZfbS2Vp9l6gdQw metmGyNDTRtlE6lmagId+yrFwWsnQeCjegjYYm6+q4yWDWmrxLKNzyORksXz+qxNmlTE FiURlVc4iFz6Yj0yLPRTe8VcRq1sJhle+7jcSlr+zTMQ5kiXs363u6JmWNq1hhKitMKN D8neZENrBlJofI+OrztRyc52su8FuOUsY+Z0gYlXimmysynT7sWk8F+sF6sQfo+v/EiR zOU8zmaHom7hNc10nnLml/z3dV5m8BN/WUhS+0juzGpkp6YF0Qds6rx4Vhh5ZL1petfg 1d6A== 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=zUi+fS/jJjPBgMwUjWq0k0AcHFJfaauXZ2+Du6n7l1Y=; b=czYUfRtkJ0uw+4r5ym+QfxsGJO51P7xguYYozqyZxhbLYSKV6VQz5YXFCW9YOx2a1w TuU7TKw7Bb4E4WCUULPyyh/C/PCuzY82g+40Zt8hQwmq75GuFy5uWWxlJ+16v9IJLUqo oO+nCh5E4kF2S0H7yfVuRw1MfZl7sHQuXPzhp6LYoPnrGNiLhiszC3mFGcgMirlObHwy vBjNX+jWyWm3wmRHYSeiTmVXCCOeeOEUQTJwEHgFbYnRi17MwAzPgmb6w03MmFiiZ4N3 1Fs+i6Jfz33leSk33DL3nt6RNyG8XIhBxFu6rJU9zgR+0ugYk5O6mFFpD+dCPZgna6pW 5OPw== X-Gm-Message-State: AA+aEWbhvEhWnWM4Vbh4CJQYWnw0py9q6tqBqt8Rb3PIKxB6wQdrfZJb P9PIJDlROagrAHPL7kxcuCsG/g== X-Google-Smtp-Source: AFSGD/WNXqcNCSCWDku4rlc+AfcBsh4yIGEcqfCB1qBnH47R6y65QXDoeyHilOWFMRjRG51wF/ruXQ== X-Received: by 2002:ac8:2b42:: with SMTP id 2mr28280864qtv.255.1544130045035; Thu, 06 Dec 2018 13:00:45 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id k6sm1485976qkk.60.2018.12.06.13.00.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 13:00:44 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id BE7F27EA; Thu, 6 Dec 2018 18:00:42 -0300 (-03) Date: Thu, 6 Dec 2018 18:00:42 -0300 From: Alvaro Herrera To: Tom Lane Cc: ertugrul9090@gmail.com, Peter Eisentraut , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15511: Drop table error "invalid argument" Message-ID: <20181206210042.6fu2tkbxy3vehwul@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <29810.1544129712@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Dec-06, Tom Lane wrote: > In principle, we could write some Perl code that exactly matches what > snprintf.c thinks is valid input, but I think that keeping it in sync > would be a nightmare. The concept I had in mind was to make a variant > version of snprintf.c that just validates a format string, and can be > compared to snprintf.c by diff'ing. (Or, perhaps, sprinkle snprintf.c > with #ifdefs so that compiling it with the right -D flag produces what > we want; though that might look too ugly.) If you don't mind adding > a C compiler to the list of dependencies for pg-make-po, we could imagine > having it compile up such a program at startup and then apply it to > each catalog. I don't follow. Why don't we just compile snprintf.c as-is and another .c file with a function that invokes vsnprintf on each translated string on a .po file and prints an error if vsnprintf returns EINVAL? This code runs completely under our control, and we can install whatever tools are needed. We don't need a C compiler today, but installing one is trivial. Also, we already have postgres source trees for each PG version available. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services