Skip site navigation (1) Skip section navigation (2)

Re: BUG: Protocol 3.0 ErrorResponse: Last 'null' characterseems odd

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eugen(dot)Konkov(at)aldec(dot)com
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG: Protocol 3.0 ErrorResponse: Last 'null' characterseems odd
Date: 2008-04-16 15:34:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
<Eugen(dot)Konkov(at)aldec(dot)com> writes:
>> It's part of the protocol, actually (yes, two NUL bytes -- first one
>> signals the end of the previous string, the second one signals the end
>> of the packet).

> The end of the packet can be obtained by packet length

It's designed that way intentionally to aid in error detection.  Parsing
the packet following its internal structure should end up exactly at the
end of the packet according to the length word.  Otherwise something's

There are some backwards-compatibility considerations here too (the
internal structure matches pre-V3 protocol which had no length word).
But it's a perfectly fine definition and we have absolutely no intention
of "fixing" it.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: Tom LaneDate: 2008-04-16 15:35:05
Subject: Re: BUG: Protocol 3.0: that's just odd, needing to add the number of bytes the length field occupies
Previous:From: Heikki LinnakangasDate: 2008-04-16 14:42:49
Subject: Re: BUG #4109: Typo in documentation

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group