Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aGcFV-0002Ql-Vj for pgsql-jdbc@arkaria.postgresql.org; Wed, 06 Jan 2016 00:46:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aGcFV-0008M7-2W for pgsql-jdbc@arkaria.postgresql.org; Wed, 06 Jan 2016 00:46:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aGcEz-0007nU-FH for pgsql-jdbc@postgresql.org; Wed, 06 Jan 2016 00:46:17 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aGcEq-0004wz-Uo for pgsql-jdbc@postgresql.org; Wed, 06 Jan 2016 00:46:15 +0000 Received: by mail-wm0-x229.google.com with SMTP id l65so42436052wmf.1 for ; Tue, 05 Jan 2016 16:46:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=8kdata-com.20150623.gappssmtp.com; s=20150623; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=KoysnpongEc7xMbS8MtBVwVV9f2hsGvtOghpSA9ztSA=; b=GS2VfqyK+e0mQbaYi2YwjYPA2nfRndVnDbW/avMqDwvQV0J3028Rfsw23dvLm7MIbV rxSxQGT3qxLa+ZEq1VrjA4Zy1MTPKVmlpt6xi6VDrncJ+GFz2Hq9ddXWS9F588qCHBjs wY9TxAAgpIcQsGejtnO60ozu1dEXYGtX048XT6/0O5JpO0Qu3EAuYtSOvey4HExkEmka 9SNq0neSSvA9bsu4gqCjmDSNzoOe1/5RioPf4r68XkAMPRtwYSjW1TwZG6QGBx52t6tb cUMuJ0CZVBoI8eVxugFfm2dDfwwiayN8xCLWeQtDtaPLJ85ea7ewgVFp4W9zpqE6CC5i FU5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=KoysnpongEc7xMbS8MtBVwVV9f2hsGvtOghpSA9ztSA=; b=QGhaLNpB/xQo6M6Bvth0WYf7ydnJ2iqsZ/7kmvTurTGRPUr/iVqWJGrs39xrhICG0D Ge4to3FnCe8BbbXCPtiBaMGsmFXgTyo0/XckRHF5ifYOqIiQESy5kXjCCrmptuicWxYl Y6I4xqWWlGIWp8I6yOMH2gMoYsG6BjNuFYGk6ufe7Fe24BBvUpjz2/L0r9uHwNzq93Wi qS7m4zYPxoJdOOLwDKiE7wZBVndlEONogPDN03YLEpu7wRYMooq70FVq74rQ/ZscNHry +e4PCdOuTSdHxcb35TflJ0Ezx1uvtDMGkZvoFupJjibTlUdFnVsHjnM3eJ1hl6hcuH7U qYkg== X-Gm-Message-State: ALoCoQl7siXYBaG4NK0faxwKK6J3oExxHU2VEnBIb632sBLC3g/OSEEdOhHkMcdn28JF7weiF5ZzQK7YFsHspgKnnqm8BCUd+Q== X-Received: by 10.28.214.76 with SMTP id n73mr7406234wmg.52.1452041166864; Tue, 05 Jan 2016 16:46:06 -0800 (PST) Received: from [192.168.1.129] (239.12.78.188.dynamic.jazztel.es. [188.78.12.239]) by smtp.googlemail.com with ESMTPSA id g3sm93264139wjw.31.2016.01.05.16.46.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 16:46:06 -0800 (PST) Message-ID: <568C63C4.3040703@8Kdata.com> Date: Wed, 06 Jan 2016 01:45:56 +0100 From: =?UTF-8?B?w4FsdmFybyBIZXJuw6FuZGV6IFRvcnRvc2E=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Dave Cramer CC: Vladimir Sitnikov , Kevin Wooten , List Subject: Re: Backend protocol wanted features References: <07F56911-8A74-4CBD-915B-24F851970A67@me.com> <56883940.2090100@8Kdata.com> <568BD1FD.6070600@8Kdata.com> <568BEA55.5040208@8Kdata.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------000303090202080106010803" X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------000303090202080106010803 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 05/01/16 17:31, Dave Cramer wrote: > > On 5 January 2016 at 11:07, Álvaro Hernández Tortosa > wrote: > > > On 05/01/16 15:35, Vladimir Sitnikov wrote: > > So rather than asking everybody to add new messages to the > protocol to support this, wouldn't it be better to support > LD in the driver? > > Well, it would still require to wrap one's mind around to get > that efficient. > You do not like to deallocate all server-prepared statements after > each DDL, do you? > On the other hand, JDBC driver does not know changes to which > tables/views/functions/types would impact statements prepared in > current session, thus JDBC driver has no idea which changes it > should > subscribe to. > > > That's a tough question whether to drop or re-create prepared > statements if they point to database objects that have been > modified. Needless to say, the naive approach is to drop them all > and re-create them when required. Any more clever algorithm than > this one would be an improvements. > > However, I still fail to see how this is related to how to > acquire the knowledge of schema changes. Whether you get it via v4 > protocol messages or LD, either way, you have the same problem > with the prepared statements. And, in any case, if schema changes > were to be implemented as part of the protocol, it would surely be > push messages sent asynchronously. Not that different from > consuming LD. > > My point is that I envision strong opposition to add duplicate > functionality. If schema changes could be obtained from LD, I > presume there will be opposition to *also* add it to the protocol > just because it may not be a great fit for the JDBC driver. > > > This is a systemic problem that we need to figure out. JDBC is > arguably one of the top clients for PostgreSQL, but seems to be > treated by a second class citizen. I don't think it should be > necessary to make a second connection to the backend just to get > schema changes. If anything, I am a really strong defender of Java and Postgres. So I would never allow it to be considered a second class citizen. However, I'm unsure pushing "our" requirements to a broader support for everybody *when* that can be obtained by other means, may not be enough justification. There are other parts of the protocol that require a separate connection. Those I don't like either, but it's not unheard of. Maybe the solution is different: that LD may be consumed within the same connection (if that would be possible). In any case, it won't be me rejecting that messages informing of schema changes, of course not. I just think they belong more to LD anyway :) Álvaro -- Álvaro Hernández Tortosa ----------- 8Kdata --------------000303090202080106010803 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 05/01/16 17:31, Dave Cramer wrote:

On 5 January 2016 at 11:07, Álvaro Hernández Tortosa <aht@8kdata.com> wrote:

On 05/01/16 15:35, Vladimir Sitnikov wrote:
So rather than asking everybody to add new messages to the protocol to support this, wouldn't it be better to support LD in the driver?
Well, it would still require to wrap one's mind around to get that efficient.
You do not like to deallocate all server-prepared statements after
each DDL, do you?
On the other hand, JDBC driver does not know changes to which
tables/views/functions/types would impact statements prepared in
current session, thus JDBC driver has no idea which changes it should
subscribe to.

    That's a tough question whether to drop or re-create prepared statements if they point to database objects that have been modified. Needless to say, the naive approach is to drop them all and re-create them when required. Any more clever algorithm than this one would be an improvements.

    However, I still fail to see how this is related to how to acquire the knowledge of schema changes. Whether you get it via v4 protocol messages or LD, either way, you have the same problem with the prepared statements. And, in any case, if schema changes were to be implemented as part of the protocol, it would surely be push messages sent asynchronously. Not that different from consuming LD.

    My point is that I envision strong opposition to add duplicate functionality. If schema changes could be obtained from LD, I presume there will be opposition to *also* add it to the protocol just because it may not be a great fit for the JDBC driver.

This is a systemic problem that we need to figure out. JDBC is arguably one of the top clients for PostgreSQL, but seems to be treated by a second class citizen. I don't think it should be necessary to make a second connection to the backend just to get schema changes.

    If anything, I am a really strong defender of Java and Postgres. So I would never allow it to be considered a second class citizen. However, I'm unsure pushing "our" requirements to a broader support for everybody *when* that can be obtained by other means, may not be enough justification.

    There are other parts of the protocol that require a separate connection. Those I don't like either, but it's not unheard of. Maybe the solution is different: that LD may be consumed within the same connection (if that would be possible).

    In any case, it won't be me rejecting that messages informing of schema changes, of course not. I just think they belong more to LD anyway :)

    Álvaro

-- 
Álvaro Hernández Tortosa


-----------
8Kdata

--------------000303090202080106010803--