Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9AD78636612 for ; Wed, 12 May 2010 11:59:54 -0300 (ADT) 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 13313-02-4 for ; Wed, 12 May 2010 14:59:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by mail.postgresql.org (Postfix) with ESMTP id CB082636D6A for ; Wed, 12 May 2010 11:48:11 -0300 (ADT) Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OCDEG-0003uW-Lf; Wed, 12 May 2010 08:48:08 -0600 Received: from [208.187.158.94] (helo=[172.16.1.220]) by in01.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OCDEF-0007Kq-K0; Wed, 12 May 2010 08:48:08 -0600 Message-ID: <4BEAC088.4030908@gmail.com> Date: Wed, 12 May 2010 08:51:52 -0600 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Thunderbird/3.0.4 MIME-Version: 1.0 To: pgsql-sql@postgresql.org References: <00da01caf04b$c182f900$4488eb00$@com> <016a01caf1be$be59d900$3b0d8b00$@com> In-Reply-To: <016a01caf1be$be59d900$3b0d8b00$@com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: pgsql-sql@postgresql.org, rsargent@amirsys.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;pgsql-sql@postgresql.org X-Spam-Relay-Country: Subject: Re: Invalid message format Exception X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201005/48 X-Sequence-Number: 34096 I'm sure most will urge you to move to UTF-8 encoding asap. Have you tracked down the "offending" insert statement? Perhaps it's a trigger trying to generate a log message? On 05/12/2010 04:34 AM, Gnanakumar wrote: > Hi, > > Because there was no response for this question already posted in > pgsql-jdbc@postgresql.org mailing list, I'm posting it here. > > I'm using PostgreSQL 8.2 and my production server is based on CentOS release > 5.2 (Final). > > JDBC Jar: postgresql-8.2-508.jdbc4.jar > > I noticed from my server log that some INSERT statements are failing with > "invalid message format" PSQLException. Once this exception is thrown, it > is not committed to the database. What could be the reason for this? > > EXCEPTION > org.postgresql.util.PSQLException: ERROR: invalid message format > > STACKTRACE > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorI > mpl.java:1592) > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.ja > va:1327) > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:193) > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.j > ava:452) > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2St > atement.java:337) > org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2State > ment.java:283) > > I also read about this on: > http://archives.postgresql.org/pgsql-jdbc/2008-04/msg00085.php > "JDBC driver is doing something wrong when calculating a message > length or message content for the frontend/backend protocol" > But how do I resolve this issue? > http://archives.postgresql.org/pgsql-jdbc/2004-03/msg00142.php > you can't represent a \0 byte in a text/varchar constant > > Even though I don't have much idea on encoding, I have a little doubt on > whether encoding is a problem. > > Here is my database encoding: > mydb=# \l > List of databases > Name | Owner | Encoding > ----------------------+----------+----------- > mydb | zoniac | SQL_ASCII > > Any pointers in right direction are appreciated. > > >