pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedInvalid message format Exception
5+ messages / 2 participants
[nested] [flat]
* Invalid message format Exception
@ 2010-05-10 14:19 Gnanakumar <gnanam@zoniac.com>
2010-05-12 10:34 ` Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
0 siblings, 1 reply; 5+ messages in thread
From: Gnanakumar @ 2010-05-10 14:19 UTC (permalink / raw)
To: pgsql-jdbc@postgresql.org
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Invalid message format Exception
2010-05-10 14:19 Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
@ 2010-05-12 10:34 ` Gnanakumar <gnanam@zoniac.com>
2010-05-12 14:51 ` Re: Invalid message format Exception Rob Sargent <robjsargent@gmail.com>
2010-05-13 07:04 ` Re: Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
0 siblings, 2 replies; 5+ messages in thread
From: Gnanakumar @ 2010-05-12 10:34 UTC (permalink / raw)
To: pgsql-sql
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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Invalid message format Exception
2010-05-10 14:19 Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
2010-05-12 10:34 ` Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
@ 2010-05-12 14:51 ` Rob Sargent <robjsargent@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Rob Sargent @ 2010-05-12 14:51 UTC (permalink / raw)
To: pgsql-sql
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.
>
>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Invalid message format Exception
2010-05-10 14:19 Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
2010-05-12 10:34 ` Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
@ 2010-05-13 07:04 ` Gnanakumar <gnanam@zoniac.com>
2010-05-13 15:18 ` Re: Invalid message format Exception Rob Sargent <robjsargent@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Gnanakumar @ 2010-05-13 07:04 UTC (permalink / raw)
To: robjsargent@gmail.com; pgsql-sql
Hi Rob,
> I'm sure most will urge you to move to UTF-8 encoding asap.
Did you mean the database encoding to changed from SQL_ASCII to UTF-8?
> Have you tracked down the "offending" insert statement? Perhaps it's a
> trigger trying to generate a log message?
No, I don't have any trigger on this table for INS/UPD/DEL.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Invalid message format Exception
2010-05-10 14:19 Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
2010-05-12 10:34 ` Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
2010-05-13 07:04 ` Re: Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
@ 2010-05-13 15:18 ` Rob Sargent <robjsargent@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Rob Sargent @ 2010-05-13 15:18 UTC (permalink / raw)
To: gnanam@zoniac.com; +Cc: pgsql-sql
On 05/13/2010 01:04 AM, Gnanakumar wrote:
> Hi Rob,
>
>> I'm sure most will urge you to move to UTF-8 encoding asap.
> Did you mean the database encoding to changed from SQL_ASCII to UTF-8?
>
Yes. That's pretty much the standard now. I think it's Postgres'
default installation now (but don't quote me on that).
>> Have you tracked down the "offending" insert statement? Perhaps it's a
>> trigger trying to generate a log message?
> No, I don't have any trigger on this table for INS/UPD/DEL.
>
I think you'll need to track down example of inserts which are causing
the problem.
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2010-05-13 15:18 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-05-10 14:19 Invalid message format Exception Gnanakumar <gnanam@zoniac.com>
2010-05-12 10:34 ` Gnanakumar <gnanam@zoniac.com>
2010-05-12 14:51 ` Rob Sargent <robjsargent@gmail.com>
2010-05-13 07:04 ` Gnanakumar <gnanam@zoniac.com>
2010-05-13 15:18 ` Rob Sargent <robjsargent@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox