Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5vSw-0000HA-7w for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2017 14:41:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5vSv-0008D7-2F for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2017 14:41:17 +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 1d5vSu-0008Cw-Gd for pgsql-hackers@postgresql.org; Wed, 03 May 2017 14:41:16 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d5vSq-0001MH-Oz for pgsql-hackers@postgresql.org; Wed, 03 May 2017 14:41:15 +0000 Received: by mail-wm0-x232.google.com with SMTP id m123so60546192wma.0 for ; Wed, 03 May 2017 07:41:12 -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=7aVxWpLJ0+RRRkjJDEOzvX5A8bTOS+NVGdw0L59WVIY=; b=iLryqw8pPXlboPaqqTvioARG5Ya3P2BvSfxg7MBIc3AW6lbQSU0+duRMToczDe/w81 fVZd3Wa+gUi03NIKiVbCtuwjpTuoYImg3LFU9ZmSZNKdDX3FilFtAi1QdwPpGaocTR8r YBpIBxhYlXbQ4KVzHhSi9QHrSdbXtFI5GaIK2HN5x0Jx+YzIuNkuKRJNQh7P7Zvp1+YT QB8fLguhp6kSSDa2sOsT4kF6MFmbZ1oFfQ5IPaHp21mwkp1DEVgE3ddvWxLCIJMNsdmi qqqsHTlJO04M74fwU3CAOjQQ5eqiB9zuudCpYeUb1zCTwIWbr/YXFNh8+ad7eS56ImIv DOIw== 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=7aVxWpLJ0+RRRkjJDEOzvX5A8bTOS+NVGdw0L59WVIY=; b=uR3OnEguz1V97+BxSBOtAVo4c4FYkK0XSfnmnVxT6U2WucwFQhzlzvl/dA1FcTt6qT CM8D/uSI+N3IxnTL8GYPlF+/mcZhNvgOzRJcTqGdAAQu/GFecF53NRFxd4APuoMQTGHf 6Frw7XGkLu1k6W+HSu9lnlKz7YS3eN5eN5BFoFW6XOxTAq4jzdfX7ebqgYdVcEfTjYE6 FPDDljvf8wWiaKbiy+bkG6zhVGzKIv+7a9RkN8cyzDqV9PPFl7h44IZZ49NnldVOsYJ9 HSJNOOgZkuAZDo/YvQDEuu2n9lhDou+cgJ6qa4rViwMpdbJ7EYfxMRzFce57DuXWPFTx biig== X-Gm-Message-State: AODbwcBMtRkJ6WszKlbiVvAb05+6i8NZtxNkcB6DCSOTkFQ7IC6NeB17 EfhU89kNHQifsUdwo54+X3gTkSnJQIBZiU5NvFUtzDzcJGhyEQ9k5lgKw5hlOlJmPy02f4cQ9fn sqZOtkkXBV37aDX5gTUbfQ2YWpJZnGi+347n/FNi6SvvL9nyAnjH7T1+8Mrz6uL54ZZ+lVXIJ X-Received: by 10.28.26.82 with SMTP id a79mr447136wma.119.1493822469259; Wed, 03 May 2017 07:41:09 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id m185sm4282568wma.7.2017.05.03.07.41.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 May 2017 07:41:08 -0700 (PDT) Subject: Re: logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling) To: Tom Lane References: <27478.1493727233@sss.pgh.pa.us> <29431.1493730652@sss.pgh.pa.us> <360a1932-7af4-609b-94f1-2ad419430869@2ndquadrant.com> <9174dc31-787a-a2f6-818f-cb4a5c1dfddb@2ndquadrant.com> <30166.1493731904@sss.pgh.pa.us> Cc: Robert Haas , Michael Paquier , PostgreSQL mailing lists From: Petr Jelinek Message-ID: <7ccb3bbb-09f7-cc3e-dbf0-b88d846faf5d@2ndquadrant.com> Date: Wed, 3 May 2017 16:41:07 +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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 16:14, Petr Jelinek wrote: > On 02/05/17 15:31, Tom Lane wrote: >> Petr Jelinek writes: >>> Let me expand, if we don't drop the slot by default when dropping >>> subscription, we'll have a lot of users with dead slots laying around >>> holding back WAL/catalog_xmin, that's really bad. If we do drop by >>> default like now, we need option to not do that, neither RESTRICT, nor >>> CASCADE fit that. >> >> I'm not sure which part of "you can't have an option in DROP" isn't >> clear to you. Whatever the default behavior is always has to work, >> because that is what's going to happen during DROP OWNED BY, or >> DROP DATABASE. > > You are saying it like there was some guarantee that those commands > can't fail because of other objects. AFAIK for example drop database can > trivially fail just because there is replication slot in it before PG10 > (IIRC Craig managed to fix that in 10 for unrelated reasons). > Btw looks like I already forgot how this stuff behaves. Existence of subscription currently also prevents DROP DATABASE (for same reason active backends do). DROP OWNED BY ignores SUBSCRIPTION too now, although I think it might not be strictly necessary to stay that way. But if we keep this behavior then the point about these two commands cascading to subscriptions is largely moot. -- 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