Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 05D70634C00 for ; Mon, 10 May 2010 11:19:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 58030-05-4 for ; Mon, 10 May 2010 14:19:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rs47.luxsci.com (rs47.luxsci.com [65.61.166.88]) by mail.postgresql.org (Postfix) with ESMTP id 5839A63383D for ; Mon, 10 May 2010 11:19:12 -0300 (ADT) Received: from gnanam (ABTS-TN-Static-186.58.165.122.airtelbroadband.in [122.165.58.186] (may be forged)) (authenticated bits=0) by rs47.luxsci.com (8.13.1/8.13.7) with ESMTP id o4AEJ57A030412; Mon, 10 May 2010 09:19:08 -0500 Reply-To: From: "Gnanakumar" To: Subject: Invalid message format Exception Date: Mon, 10 May 2010 19:49:04 +0530 Organization: Zoniac Software Private Limited Message-ID: <00da01caf04b$c182f900$4488eb00$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcrwS7XXxS87SvvJQpy6HKKpcF+lNA== Content-Language: en-us x-cr-hashedpuzzle: AKHs BFGL BSIL BaQJ C5I9 DqdL ERpk E9/w FThm Fpb1 G5EB HDjp HweG H4hY JBqm JEOn; 1; cABnAHMAcQBsAC0AagBkAGIAYwBAAHAAbwBzAHQAZwByAGUAcwBxAGwALgBvAHIAZwA=; Sosha1_v1; 7; {311DEBD2-55BB-4B69-B85A-D7D76937C2D6}; ZwBuAGEAbgBhAG0AQAB6AG8AbgBpAGEAYwAuAGMAbwBtAA==; Mon, 10 May 2010 14:18:49 GMT; SQBuAHYAYQBsAGkAZAAgAG0AZQBzAHMAYQBnAGUAIABmAG8AcgBtAGEAdAAgAEUAeABjAGUAcAB0AGkAbwBuAA== x-cr-puzzleid: {311DEBD2-55BB-4B69-B85A-D7D76937C2D6} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.069 tagged_above=-10 required=5 tests=BAYES_20=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=0.77 X-Spam-Level: X-Archive-Number: 201005/26 X-Sequence-Number: 20510 Hi, 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. mydb=# \l List of databases Name | Owner | Encoding ----------------------+----------+----------- mydb | zoniac | SQL_ASCII