Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQHeh-00052I-Bg for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Nov 2018 20:02:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gQHeg-0003RV-3U for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Nov 2018 20:02:22 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQHef-0003RN-SN for pgsql-hackers@lists.postgresql.org; Fri, 23 Nov 2018 20:02:21 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQHed-0007BO-50 for pgsql-hackers@postgresql.org; Fri, 23 Nov 2018 20:02:21 +0000 Received: by mail-wr1-x442.google.com with SMTP id x10so13371320wrs.8 for ; Fri, 23 Nov 2018 12:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qpncAkXnYz0aqjgvF3EiXuZswCeswoMEiF6NFIo8lGI=; b=AuR15XL70wH3zxmdZkx/W6X4afXzpRsV8F2cMC5URc8wqbtQvIs741KtZJrVvG/zJR trwXgWzJEOE4NJY4esE9CC2g+/f4WLZQp1KsBZIMroEWKu/GwN5SMlnq9I8RyaE6g0OB SF4T3oc0JpmRwDy7Sar1IjdCZCtJG6/0Lrklk1G0mvRgo/zw5fwYOZeL6LbDhE8zA1oa cbs/5IrLsFMwODpiacggQopPeu4+YnUqiBo/bPC4OSKfF+DpcWkbXpB79bdgOReNiFuG jfedqkZXK91iS6zhXo3t9pnHV9l8B13S25asOzVLQCDi9wh9KhkQ/uHyGiGRsC/NDmUM GV5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qpncAkXnYz0aqjgvF3EiXuZswCeswoMEiF6NFIo8lGI=; b=GWG6v31i++n0sU3lFZTSpt7NXwpFgbd7Qko/Ed6G3pCzYFpKKkaQ7WCSWzoPj2Ybs7 u6AizXo/Wx1CvnZle+ajtkHm0gtWcSHLJUfA5zi9C5K06BQW/gI+o5y6Ntyr7oQLQo72 +uTiAzJ395+ACg3EPDAs9s2xUYwMdr4D2d3LulOS2wzsKx5Ps/K/cyz/51eiVuvDZpVr ovBNOhXotOpN54L5mX4GEo2+qyFdUyWObSa+ArASiy5mvB9rw1m0ziKa78xJcKq7QnK1 qDn8jyEAjIEyu6484nrdSHCG7t9b8rFJRONDSRTZSFujG+ZiNU+URZk/hFS6us6H5H3Y xQnQ== X-Gm-Message-State: AA+aEWYVOpncXSDqVIQdQg01EINLHPvBAzPY7wX0/4mWP0bQEcRa14NH NKaNGUKXqiNFPyD61khoaIuttg== X-Google-Smtp-Source: AFSGD/V37hg6+0KyrQwDVrjW44wl4gPLIwcww8uK1PGOpgWDS1TgdQwet1JaacC+D1VosJKzmGAVSg== X-Received: by 2002:a5d:55c9:: with SMTP id i9mr14702749wrw.287.1543003338391; Fri, 23 Nov 2018 12:02:18 -0800 (PST) Received: from [10.137.2.19] (ip-86-49-251-50.net.upcbroadband.cz. [86.49.251.50]) by smtp.gmail.com with ESMTPSA id 68sm8727136wmt.10.2018.11.23.12.02.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 12:02:17 -0800 (PST) Subject: Re: row filtering for logical replication To: Petr Jelinek , fabriziomello@gmail.com Cc: Euler Taveira de Oliveira , Pgsql Hackers , hironobu@interdb.jp References: <7106a0fc-8017-c0fe-a407-9466c9407ff8@2ndquadrant.com> <92e5587d-28b8-5849-2374-5ca3863256f1@2ndquadrant.com> <466cdec7-92a0-41c0-b74a-ec0be94d4451@2ndquadrant.com> <8c88c6ac-2d34-e577-0aa3-2a190ae0f4f7@2ndquadrant.com> From: Tomas Vondra Message-ID: <18255112-5067-c371-eacf-93c7be04d313@2ndquadrant.com> Date: Fri, 23 Nov 2018 21:02:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <8c88c6ac-2d34-e577-0aa3-2a190ae0f4f7@2ndquadrant.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/23/18 8:14 PM, Petr Jelinek wrote: > On 23/11/2018 19:29, Fabrízio de Royes Mello wrote: >> >> On Fri, Nov 23, 2018 at 4:13 PM Petr Jelinek >> > wrote: >>> >>>> >>>> If carefully documented I see no problem with it... we already have an >>>> analogous problem with functional indexes. >>> >>> The difference is that with functional indexes you can recreate the >>> missing object and everything is okay again. With logical replication >>> recreating the object will not help. >>> >> >> In this case with logical replication you should rsync the object. That >> is the price of misunderstanding / bad use of the new feature. >> >> As usual, there are no free beer ;-) >> > > Yeah but you have to resync whole subscription, not just single table > (removing table from the publication will also not help), that's pretty > severe punishment. What if you have triggers downstream that do > calculations or logging which you can't recover by simply rebuilding > replica? I think it's better to err on the side of no data loss. > Yeah, having to resync everything because you accidentally dropped a function is quite annoying. Of course, you should notice that while testing the upgrade in a testing environment, but still ... > We could also try to figure out a way to recover from this that does not > require resync, ie perhaps we could somehow temporarily force evaluation > of the expression to have current snapshot. > That seems like huge a can of worms ... cheers -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services