Protocol V3 questions (StartupMessage and ParameterStatus)

From: Barry Lind <blind(at)xythos(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Protocol V3 questions (StartupMessage and ParameterStatus)
Date: 2003-05-08 05:56:44
Message-ID: 3EB9F19C.6010004@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom,

While implementing the V3 protocol I have come across the following
questions:

1)
Why does the StartupMessage not follow the documentation. It appears
that an extra undocumented \0 is necessary after the parameter
name/value pairs. Or at least that is what I needed to get a successful
connection. So when I tried to send: "user\0test\0database\0test\0"
with a message length of 32 (4+4+24) I got the error "invalid startup
packet layout: expected terminator as last byte", however if I send
"user\0test\0database\0test\0\0" with a message length of 33, then it
works. Is this a doc bug, or a code problem?

2)
In looking at the ParameterStatus messages that I am getting back from
the server, I have a question about the value being returned for
datestyle. Since I am in the process of converting to the new protocol,
I am still sending a query that issues a "set datestyle to 'ISO'". The
ParameterStatus response I get from this query is: "DateStyle\0ISO with
US (NonEuropean) conventions". I would have expected "DateStyle\0ISO".
It appears that the value reported by ParameterStatus isn't
actually a valid value, since if you try to issue a set datestyle to
'ISO with US (NonEuropean) conventions' you get an error message. So my
question is how does one parse the value of the datestyle parameter? It
appears (although I haven't verified) that the value will change
depending on language since I am assuming the words 'with' and
'conventions' will be translated. I would have expected that set and
show would use the same set of possible values.

thanks,
--Barry

PS. Tom, since your spam filter blocks my email, I can't send directly
to you, thus I need to CC the hackers list. Can you whitelist me? Or is
it OK to continue sending these questions to the hackers list?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kurt Roeckx 2003-05-08 06:11:47 Re: CIDR in pg_hba.conf
Previous Message Tom Lane 2003-05-08 04:25:07 Re: could not read transaction log directory ...?