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 1glGad-0005yS-LT for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Jan 2019 17:08:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glGab-0000BD-A5 for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Jan 2019 17:08:53 +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 1glGaa-0000Az-Vb for pgsql-hackers@lists.postgresql.org; Sun, 20 Jan 2019 17:08:53 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glGaX-0005jH-GV for pgsql-hackers@lists.postgresql.org; Sun, 20 Jan 2019 17:08:51 +0000 Received: from feivel.credativ.lan ([50.234.0.119]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N3KY0-1hC6uc0jPW-010PKg; Sun, 20 Jan 2019 18:08:44 +0100 Received: from localhost (localhost [127.0.0.1]) by feivel.credativ.lan (Postfix) with ESMTP id 017BEE007F; Sun, 20 Jan 2019 18:08:40 +0100 (CET) Message-ID: Subject: Re: Thread-unsafe coding in ecpg From: Michael Meskes To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Date: Sun, 20 Jan 2019 18:08:40 +0100 In-Reply-To: <24002.1547944649@sss.pgh.pa.us> References: <31420.1547783697@sss.pgh.pa.us> <0be2e83c4dec0d2f1f8eb55b1e95ad98b12ede24.camel@postgresql.org> <23046.1547943059@sss.pgh.pa.us> <907962be808367ff475893ce07a8442700e3e65a.camel@postgresql.org> <24002.1547944649@sss.pgh.pa.us> Organization: PostgreSQL Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:bbLWU+XB65H0cjBf9EBpq4SmUPfafrK7zMskEjQk8tYhy46B9WN mwxf7R1wxyJHieYfQ7dGtsCNEP+oL+uhZuKFXZOLXVdoa6lYlsmeH0fyLepBjW46fVp9vwF 0jMuuvxJ27a4Ms9B/ryevsRrLytx4WcU5xGIKf+koqMP9DTTO4HG3+KeXWNUWHSIKN1MCES r7L/3JQiWhlCCUdyVtKaw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pwZsDjoezzo=:3eQt/DQFv2SJtnc4qjMtzy Rzckp8dVxf+BARZzDnHlpzS0EJoC7oGdurodYCIX6dWcMzDFTscChl8lFV7Ceyk1uH46NUUSZ 0gVzecue9S5aLXHjwq/mP5OBVqd2vA32EVFIXt19ydOoLteTJt7Puze05jtP4/sP2bC0Nfqqh sKRE4uS+m34mUiIluoP81twhQZLP4rrgg4lyITylS4unkiCgYFJDe9vPEKtiUCjEy7iQB23po H1QLlqLaHMEiztPI36iPbqG3V3UbpmLUWkT24Z7nj4J1dqIHmfLimOw8ma0fRS0NFvU6fE1rp qZvR0DBeLFRdbr09kmPGMfBqdqKOi/I8QXVqYxh9YDDwYDBtioPgBdf6MVklpJW24AN72DFo9 LxzrgHeQ2YAYo7e7NPToPUxfqApLfrRHN6tXAOuA7i3M/GOZFcmDTV1xU5I0xVX0Veq8bj4Yt wj/kBvTkSlrrsPGH8fugHkX64CooZOUM2KwBoJLx3mjycXs97RddkfKssuLtbnCpUSXGGRuHn lxY6fIJtakjR17q/tVUCsG63M1rnv8w9Z2quV+cr/t148VZa/zQ2YhDk8N+ziKzY09DwRZEBa ncHupjmqMs29125PYnD3iPxvNkS+gcQR+Qta3gz4ZQD25F6rIRwl4d/A7CAbATp55rlWdyiAr h+i3H7KQTTA+r6Y+91dMdMhG2+3HZ2dPknKF6WA8EJ8fbpBYeFF5W90V2Im8Wvg2AbNSwx8oy RuQJXUhyuSmY10nt8dfsnvRv7JpCv8RjYzGrarjMpzC/koeKNHFsV7Uxdh8= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > > The question is, what do we do on those platforms? Use setlocale() > > or > > fallback to (a) and document that ecpg has to run in a C locale? > > No, we shouldn't use setlocale(), because it clearly is hazardous > even on platforms where it doesn't fail outright. I don't see > anything so wrong with just documenting the hazard. The situation Actually I meant using setlocale() and documenting that it must not be used with threads, or document it must not be used with locales? Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL