Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5XDO-00006q-2S for pgsql-hackers@arkaria.postgresql.org; Tue, 02 May 2017 12:47:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5XDN-0000zr-L9 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 May 2017 12:47:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5XBr-0005nw-9f for pgsql-hackers@postgresql.org; Tue, 02 May 2017 12:46:03 +0000 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d5XBn-0004xe-FJ for pgsql-hackers@postgresql.org; Tue, 02 May 2017 12:46:02 +0000 Received: by mail-wr0-x230.google.com with SMTP id w50so79307715wrc.0 for ; Tue, 02 May 2017 05:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=4buIP8CdfKMm3b0Rl+PdTUyDSqrOl17qtyGZllx/aq4=; b=ZhGDC3me5BBp+S5GG4OZYJ+95Cu1ZXDQ7EgmXCyBrb30S0WISQHCM+kSnZlzGEChzh CXnmgQ906iQUvySlgctdISWB6zJek63Wcc1hPiG8Ftcnvb5kUAXjkjcw6VdHwSIcBtzJ Cv26EseoZ+HymhGBJkX2ISuDPAfck+hgVMbtIh7wDGdulNA28//PqoVTIlb+XtwM9J4M nTb+rSW5IGhPcXqPXhjHAdhIYpBCgwoikbdqqeLbz9YwyyqepW42h5iCtVGzjOtu8Bx8 CZZtE6+USCQqsbdKQ/h1RCpjY45it3DB+VtEmV7LO5sQkZ5kwsKITQZEe7txNhfBldyf p2ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=4buIP8CdfKMm3b0Rl+PdTUyDSqrOl17qtyGZllx/aq4=; b=a14HlBUEyyZrAaHYSjhtcQFZs4FO2f2yM8YdTGYvZCmYnaW9dsxvyzCIGQCsQe3o2m ATQru9sPG78C0YKm0pRZ2WtV8SJC7PWviFGo5CEkfGa4DxN/kbP7hNkqp88rHeNFLXhC 64UrFd1G4/ZwT78z70zM6we+FcR3UgpM2fAA2x8x82wAHFkK4ZqcfaJhM9cLPt4zL5tf AvlH/+h1Paza+gYK/PyFqFc4lsuMIrQvxBHgqIKO9plYOLxBofWOVPx3DzA58FXBL10j NTaZ9G5o4KgbLcGeeII2h8AsH264uUGG7I5tACFSO8US/xzcLbTHLE3eKYg8RNaZE1S8 cVig== X-Gm-Message-State: AN3rC/6VZwCAjuEFx88ol2IpQI5CmxmfDeHj7dAPvS8dRxpcP8RFSK10 EYTvQ6l9PGKckGv0uE6nqcbOR8VfZT1Q2Ub/rdQVsqThcq3W3eG8gTscYcIagkMWnSOnxat/6dW qGHe25koL0Kk9tZ6nOk1idRlDD8BhhMmTDtdkHlvhHWd0nSVlfQi6577ZhkPyyPRnzs05cjXb X-Received: by 10.223.131.196 with SMTP id 62mr5856689wre.162.1493729158317; Tue, 02 May 2017 05:45:58 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id u4sm870045wmu.0.2017.05.02.05.45.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 05:45:57 -0700 (PDT) Subject: Re: logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling) To: Tom Lane , Robert Haas References: <27478.1493727233@sss.pgh.pa.us> Cc: Michael Paquier , PostgreSQL mailing lists From: Petr Jelinek Message-ID: Date: Tue, 2 May 2017 14:45:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <27478.1493727233@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 02/05/17 14:13, Tom Lane wrote: > Robert Haas writes: >> On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek >> wrote: >>> DROP SUBSCRIPTION mysub NODROP SLOT; > >> I'm pretty uninspired by this choice of syntax. Logical replication >> seems to have added a whole bunch of syntax that involves prefixing >> words with "no". In various places, there's NODROP, NOREFRESH, NOCOPY >> DATA, NOCONNECT, and NOPUBLISH. But "NO" is not an English prefix, >> and there's no precedent of which I'm aware for such SQL syntax. In >> most places, we've chosen to name the option and then the user set it >> to "on" or "off". So for example you type EXPLAIN (ANALYZE, TIMING >> OFF) or EXPLAIN (ANALYZE, TIMING FALSE), not EXPLAIN (ANALYZE, >> NOTIMING). I think most of the logical replication stuff could have >> been done this way pretty easily, but for some reason it picked a >> completely different approach. > > I tend to agree with this criticism, but it's not quite true that we > don't do this anywhere else --- see CREATE USER for one example, where > we have monstrosities like NOBYPASSRLS. Still, at least those are single > words without arguments. "NODROP SLOT" is pretty ugly, not least > because if you want to claim CREATE USER as syntax precedent, you ought > to spell it NODROPSLOT. > > Having said that, I doubt that anyone would argue that CREATE USER is > anything but legacy syntax, or that our more recent syntax designs aren't > better models to follow. > > It's not quite too late to revisit the syntax of the log rep commands > ... shall we add this as an open item? I am happy to implement something different, it's quite trivial to change. But I am not going to propose anything different as I can't think of better syntax (if I could I would have done it). I don't like the OFF or FALSE (ie DROP SLOT OFF) any more than what is there now and it also seems to not map very well to action (as opposed to output option as it is in EXPLAIN). It might not be very close to SQL way but that's because SQL way would be do not do any of those default actions unless they are actually asked for (ie NODROP SLOT would be default and DROP SLOT would be the option) but that's IMHO less user friendly. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers