Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id A32532EBA7B; Thu, 24 Nov 2011 14:55:09 -0400 (AST) Received: from auth-smtp.nebula.fi ([217.30.180.105]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RTeRv-0003WE-NH; Thu, 24 Nov 2011 18:55:08 +0000 Received: from quadvadis.localdomain (gw.nitor.fi [83.145.228.24]) (authenticated bits=0) by auth-smtp.nebula.fi (8.13.8/8.13.4) with ESMTP id pAOIsixl001369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Nov 2011 20:54:44 +0200 Message-ID: <4ECE92F3.9000402@nitorcreations.com> Date: Thu, 24 Nov 2011 20:54:43 +0200 From: Mikko Tiihonen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Kevin Grittner CC: oliver@opencloud.com, tgl@sss.pgh.pa.us, mmoncure@gmail.com, pgsql-hackers@postgresql.org, pgsql-jdbc@postgresql.org Subject: Re: [JDBC] Optimize postgres protocol for fixed size arrays References: <4ECD3D12020000250004347E@gw.wicourts.gov> In-Reply-To: <4ECD3D12020000250004347E@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 201111/1444 X-Sequence-Number: 198929 On 11/24/2011 02:36 AM, Kevin Grittner wrote: > Oliver Jowett wrote: > >> Can we get a mechanism for minor protocol changes in this future >> version? Something as simple as exchanging a list of protocol >> features during the initial handshake (then use only features that >> are present on both sides) would be enough. The difficulty of >> making any protocol changes at the moment is a big stumbling block. > > I've been thinking the same thing. Any new protocol should include a > way for each side to publish a list of what it can accept from the > other during initial handshaking. > >> (You could probably retrofit that to the current protocol version) > > Perhaps. It would be great if both sides could recognize the case > where the "feature negotiation" was absent and use a default feature > list for the protocol available on the other end. What about a hand-shake protocol based on simple binary-protocol minor version instead of features. We keep the v3 protocol as is but can add cumulative conditionally enabled features when we bump the minor version. The hand shake requires that the server sends a parameter back with it's highest supported minor version: FE=> StartupPacket <=BE ParameterStatus(binary_minor = 23) And the client can send any number between 1<=binary_minor back to enable newer protocol versions and/or limit what the server sends FE=> Execute(SET binary_minor = 20) To keep full backwards compatibility: 1) if backend does not send a binary_minor parameter on connection the highest supported minor version is assumed to be 0 (current format) 2) the backend assumes the active minor version is 0 unless the SET binary_minor is received I think bumping a minor version is better than feature flags because: 1) the hand shake is simpler and faster 2) coding is easier as all previous features are known to be supported and active when implementing feature+1 I'm not exactly sure about the COPY BINARY feature Tom mentioned. But probably we could prefix the data with the int4 containing the minor version? -Mikko