Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4061F3C3DB5 for ; Sun, 6 Nov 2011 16:30:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 35075-02-5 for ; Sun, 6 Nov 2011 20:30:28 +0000 (UTC) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 99CD51B537B1 for ; Sun, 6 Nov 2011 16:30:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.cybertec.at (mail.cybertec.at [87.118.110.48]) by mx1.hub.org (Postfix) with ESMTP id 11515A82821 for ; Sun, 6 Nov 2011 04:12:05 -0400 (AST) Received: from localhost.localdomain (host-87-242-22-111.prtelecom.hu [87.242.22.111]) by mail.cybertec.at (Postfix) with ESMTP id 6A78F5FC353 for ; Sun, 6 Nov 2011 09:11:19 +0100 (CET) Message-ID: <4EB64135.4060102@cybertec.at> Date: Sun, 06 Nov 2011 09:11:33 +0100 From: Boszormenyi Zoltan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: Locale problem with psqlODBC under Fedora 16 References: <4EB603C9.1000000@cybertec.at> In-Reply-To: <4EB603C9.1000000@cybertec.at> Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/13 X-Sequence-Number: 10731 2011-11-06 04:49 keltezéssel, Zoltan Boszormenyi írta: > Hi, > > I just installed Fedora 16 and it has PostgreSQL 9.1.1 and > postgresql-odbc-09.00.0200 (which is psqlODBC). > > My problem comes from this code: > > SQLBindParameter(hStmt,13, > SQL_PARAM_INPUT, SQL_C_DOUBLE, SQL_NUMERIC, 0, 0, > (SQLPOINTER)&co2, sizeof(co2), NULL); > > New value of "co2" is 99.47 but as my Hungarian locale uses comma > instead of dot for a decimal separator, this pops up: > > ERROR: invalid input syntax for type numeric: "99,47" at character 210 > STATEMENT: update al set > megr=1,fpont=1478,csopvez=79,datum='2011-09-05'::date,d1='2011-09-04'::date,t1='21:30:00'::time,d2='2011-09-05'::date,t2='03:00:00'::time,temp=113,n_beepites=1,n_sikeres=1,kutfejnyomas='300',co2='99,47',h2sppm=0,hibajel=E'' > where id=2805; > > With my previous system when this code was used (PostgreSQL 8.2, > psqlodbc-08.02.xxxx era), the above code worked. > > convert.c in psqlODBC hasn't changed much with regard to floating point > handling so it still uses setlocale() to switch to "C" locale and I also > recompiled the SRPM for Fedora 16 and config.h indeed contains > "#define HAVE_LOCALE_H 1" so the relevant code with setlocale() gets > compiled in. Still, something broke the locales where something else than > a decimal-dot is used for decimal separator. Same error after I bootstrapped and compiled psqlodbc-09.00.0310 from CVS. > > Best regards, > Zoltán Böszörményi > -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/