Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiqLw-00020a-50 for pgsql-general@arkaria.postgresql.org; Fri, 27 Jul 2018 00:11:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiqLt-0001p6-LZ for pgsql-general@arkaria.postgresql.org; Fri, 27 Jul 2018 00:11:25 +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.89) (envelope-from ) id 1fiqLs-0001oy-GT for pgsql-general@lists.postgresql.org; Fri, 27 Jul 2018 00:11:25 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiqLl-0005nN-9r for pgsql-general@lists.postgresql.org; Fri, 27 Jul 2018 00:11:23 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 94BD620DC6; Thu, 26 Jul 2018 20:11:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 26 Jul 2018 20:11:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=LASVL7BFjlQWIoRj0wyWYEeg0/3Zw ZyQpNIOWYF+I4M=; b=sD5HBPoA69MNptTf1xZBqTIxwyplPQgHUDv4EH1U+3wJs HgKnKLX63NaD9fx7aBuaU4k2T3rjwtXxMM9+IrCN637A/sI/Fziwskm3QZ/Bmo9j fVOaTfiLHECSStM+9+qGCUQwEgxqYshsq56JDmCpBZmwCXo5VYLGzdRLiakkQlbJ Fhfx8gnCFW+KP4lswvK8OSbuM8/Fkis1ZSEzokpEnjO8INta7jMuxaC2TulerFML NCoYC9TTbB/3GJZaYAEgNUWAtQNcKTwRk7FiTwQhO9d28lqgF82rlSh1h8qduHmQ fvRJBCJiBtz6xy3MaNSr5YnZKRUVZd7sUw4e75dIA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=LASVL7 BFjlQWIoRj0wyWYEeg0/3ZwZyQpNIOWYF+I4M=; b=ce1i3NUksRjAD9Yn4CDpIX 2cqVXqAgbLd0zJiWohRRu9qats3+6PkWWxergA5L3p3/x6puBXbRxqloAipGhUGC 2e6nQzlT22jfT6326E+/8gG+1YBulGbH7GdU+aA5m0pwKg6FDwS2REn07KRp2m8p ZSSwdtToJCCOzk3l0AliN5SNo8F8FzphFOruYR2CAzCD05GdQ36KEWqSOZJ9Ctf5 nI26Tn80Hhw/z/i6GsPBL7Lu1IT4g1oTSUZEA6ZqZoBHvmGa5X0B2rZ3IHGtJalo 4cLttl55OENLOyT4qLNKEA9W7ZZtU1lgTqtzOTnkuLAf3h4tsnAJiJcmwGZxcj2Q == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 9F7AFE405D; Thu, 26 Jul 2018 20:11:15 -0400 (EDT) Subject: Re: logical replication snapshots To: Dimitri Maziuk , pgsql-general@lists.postgresql.org References: <20180724172115.ztthbxmfgucnuuq3@alvherre.pgsql> <20180724184337.k6nq7k3cq7xoorjn@alap3.anarazel.de> <04dcfd2d-6201-09e7-4209-9894d669f694@bmrb.wisc.edu> <20180725152827.g22qmue3wgycifjh@alap3.anarazel.de> <9b9a72f4-44c8-5e78-8814-fdc39ca3a3ad@bmrb.wisc.edu> <1c539619-7b72-3669-81cd-2a55352b1008@aklaver.com> <20180726005706.gzinfqg7mjfnsf6g@alap3.anarazel.de> <10933bb0-5a3b-4ed2-fc6c-2a712510ef9b@aklaver.com> <00acc822-e5d6-b9ad-43a9-e989d8581ae7@bmrb.wisc.edu> <40f0b879-2b5b-05ad-57ba-3688510be87d@aklaver.com> <93e99c67-cdc5-e776-2a00-3ba090e2c4c4@aklaver.com> <1542cf6a-151d-24b6-afc2-b4cee0ae1aa1@bmrb.wisc.edu> From: Adrian Klaver Message-ID: Date: Thu, 26 Jul 2018 17:11:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1542cf6a-151d-24b6-afc2-b4cee0ae1aa1@bmrb.wisc.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/26/2018 04:48 PM, Dimitri Maziuk wrote: > On 07/26/2018 05:34 PM, Adrian Klaver wrote: >> On 07/26/2018 03:01 PM, Dimitri Maziuk wrote: > >>> Let me ask a different question: if I drop and re-create a published >>> table on the publisher without doing anything to the publication and >>> subscription, what happens? >> >> Take a look at: >> >> https://www.postgresql.org/docs/10/static/sql-alterpublication.html > > Thanks but what I ask (and what I suspect happened here while I wasn't > looking) is > > - create schema foo with tables bar and baz and some rows in 'em > - create publication foopub with foo.bar and foo.baz > - create subscription to foopub on the other node, initial sync and all > - drop schema foo on the publisher > - create schema foo with tables bar and baz and some rows in 'em > > The publication foopub is at this point fubar I take it? And needs to be > re-created on the publisher and reconnected on the subscriber? Complete > with with inital resync? Not sure. Personally I would try: 1) ALTER PUBLICATION DROP TABLE foo|bar; 2) ALTER PUBLICATION ADD TABLE foo|bar; 3) ALTER SUBSCRIPTION sub_name REFRESH PUBLICATION If you get to 3) it will re-sync the data unless you tell it otherwise. The above is probably dependent on the size of the publication. If you did a publication for ALL it would make more sense to do the above then if you did a publication for just foo or bar. -- Adrian Klaver adrian.klaver@aklaver.com