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

Re: [Win2k - Version 8.0.2] - StartupMessage Format Question

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "Tom Pfeifer" <tpfeifer(at)tela(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [Win2k - Version 8.0.2] - StartupMessage Format Question
Date: 2005-05-15 03:19:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On May 14, 2005, at 10:16 PM, Tom Pfeifer wrote:

> I must be missing something else.
> Am I calculating the string length correctly?
> Is the length/version/revision/string being packed correctly?
> Maybe my pack statement is all wrong?
> Any help would be much appreciated.

I don't know perl, so it is hard for me to check your work. The string 
you are building looks correct:

$string = 'user' . chr(0) . 'postgres' . chr(0) . 'database' . chr(0) . 
  'maach' . chr(0) . chr(0);

So the length of message should be = 4 + 4 + length($string)
That's 4 bytes for the message length, 4 bytes for the protocol 
version, and then the length of the string including the null bytes.

So write the total length, protocol version, and then your connect 
string. Any integer you write (Int16 and Int32 in the protocol) needs 
to be in network byte order (most significant byte first).

John DeSoi, Ph.D.
Power Tools for PostgreSQL

In response to

pgsql-novice by date

Next:From: Sim ZacksDate: 2005-05-15 06:11:32
Subject: Re: Fwd: [NOVICE] Autocommit in Postgresql
Previous:From: Tom PfeiferDate: 2005-05-15 02:16:18
Subject: Re: [Win2k - Version 8.0.2] - StartupMessage Format Question

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