Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A073E632C3B for ; Wed, 12 May 2010 07:34:57 -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 21820-09 for ; Wed, 12 May 2010 10:34:49 +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 BF0626329BA for ; Wed, 12 May 2010 07:34:50 -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 o4CAYjxT006511; Wed, 12 May 2010 05:34:47 -0500 Reply-To: From: "Gnanakumar" To: References: <00da01caf04b$c182f900$4488eb00$@com> In-Reply-To: <00da01caf04b$c182f900$4488eb00$@com> Subject: Invalid message format Exception Date: Wed, 12 May 2010 16:04:39 +0530 Organization: Zoniac Software Private Limited Message-ID: <016a01caf1be$be59d900$3b0d8b00$@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+lNABcfAYA Content-Language: en-us x-cr-hashedpuzzle: W2w= Bkzm CkKL DRwr DXqa F84c G9FZ H7GV IrpU JWbb JtzO J3Y/ KEG7 KG++ LJUn LimB; 1; cABnAHMAcQBsAC0AcwBxAGwAQABwAG8AcwB0AGcAcgBlAHMAcQBsAC4AbwByAGcA; Sosha1_v1; 7; {13187650-3CC2-4DE9-8EEE-55BFB0251CD3}; ZwBuAGEAbgBhAG0AQAB6AG8AbgBpAGEAYwAuAGMAbwBtAA==; Wed, 12 May 2010 10:34:21 GMT; SQBuAHYAYQBsAGkAZAAgAG0AZQBzAHMAYQBnAGUAIABmAG8AcgBtAGEAdAAgAEUAeABjAGUAcAB0AGkAbwBuAA== x-cr-puzzleid: {13187650-3CC2-4DE9-8EEE-55BFB0251CD3} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.069 tagged_above=-5 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/47 X-Sequence-Number: 34095 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.