Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 1DBE32E30F1 for ; Mon, 14 Jan 2008 15:23:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 57053-03 for ; Mon, 14 Jan 2008 15:23:02 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id CEC452E2ECA for ; Mon, 14 Jan 2008 15:23:04 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0EJMqnj023646; Mon, 14 Jan 2008 14:22:52 -0500 (EST) To: "Medi Montaseri" cc: "Steve Midgley" , pgsql-sql@postgresql.org Subject: Re: UTF8 encoding and non-text data types In-reply-to: <8078a1730801141101j4bc0dc4chdffee5eaebdb99da@mail.gmail.com> References: <20080113222706.73BE416DA2AB@mx1.hub.org> <478aea79.03098c0a.5f32.ffffa6e4SMTPIN_ADDED@mx.google.com> <8078a1730801141101j4bc0dc4chdffee5eaebdb99da@mail.gmail.com> Comments: In-reply-to "Medi Montaseri" message dated "Mon, 14 Jan 2008 11:01:36 -0800" Date: Mon, 14 Jan 2008 14:22:52 -0500 Message-ID: <23645.1200338572@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/114 X-Sequence-Number: 29967 "Medi Montaseri" writes: > More specifically, I am using HTML, Perl and PG. So from the HTML point of > view a textfield is just some strings. So my user would enter 12345 but > expressed in UTF8. Perl would get this and use DBI to insert it into PG > What I am experiencing now is that DB errors that I am trying to insert an > incorrect data into column "cost" which is numeric and the data is coming in > from HTML in UTF8 > Mybe I have to convert it to ASCII numbers in Perl before inserting them > into PG Uh, there is *no* difference between the ASCII and UTF8 representations of decimal digits, nor of any other character that would be allowed in input for a decimal field. I can't tell what your problem really is, but you have certainly misunderstood or misexplained it. regards, tom lane