Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrjUQ-0001yy-7T for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Nov 2021 16:26:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mrjUO-0002c5-Rj for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Nov 2021 16:26:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrjUO-0002bw-7v for pgsql-hackers@lists.postgresql.org; Mon, 29 Nov 2021 16:26:48 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mrjUI-0000zn-Se for pgsql-hackers@postgresql.org; Mon, 29 Nov 2021 16:26:47 +0000 Received: by mail-pj1-x102d.google.com with SMTP id j5-20020a17090a318500b001a6c749e697so12038838pjb.1 for ; Mon, 29 Nov 2021 08:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=v6USvDLEfQKqABZM0P4iUfcr0qUFSOy1XeIm6pFn3UE=; b=IKrY+2jKwuJBChKr4wnJ51BkTyrR3o1ixe7DzDqL1N6LeraW0rwKsdKl2NgMxQrgGh eNf0Fkedm15Rugj3iV2FHQ9pZq92zkUPIBfTCahGNOeXcWGQ9vGtjgtTB1QkpDcJdmqi 6GukhScZHOjQ8+l8MWx5BCeT7L6nttO6qw9Larpu5aXHmgGr+B/2fWLbbISlYubpWxRX 6Sr9s+vqcZFUSbuugKT9rMhBe0gYu7ykbOWiyYPW0mAb6W977+e6NLlICCHGoSq52igN VkX7PJtl6PZCvuZSIn3qfGETtVWvO0GYF8rftutUxfTID7q6aFYcRQTn1b2UdZpskUMh fkdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=v6USvDLEfQKqABZM0P4iUfcr0qUFSOy1XeIm6pFn3UE=; b=2exwHNL4XHL0xRh+f7aWqFkGZ9FR9hUIS9D8jRxcW81zm3zkq8acVciHfJxhStnGMT qHR6CFBcU0PHMaosUyi2crnjMULJEsG1ZhcZIAZgthqY7KQbJzET6gSY944m1Cu6xG// c5JvTK41BmxfxfPM7ruL5lF8G2SwV30dunFCvHcKEpsAl7+JDY20HbdcXJM2nlsEsbR5 TzLCYjODWY6cZWVnL9C9eIXeEzo5kcCeJDE8cQ3vCkVZb4RM87ikqACTwFRkAucYnSZP NwSCZkNfJEybA9Ea905RSg2nCXLbmxvcOrouYz8Ly2Q73m+CFtRL5ZFqRS+RbUTNkAwF vwSg== X-Gm-Message-State: AOAM531AUh3OTBGX2PN+uqC22CBXh+0+qkaZfA6upvI6AzMIrIgMH384 t8o9Rd9+KgL/HbbW+Cqte1/3uve7cW1WuYTZaYl3iSNoeuaKgaxYhaDAap8zQhYAFUHWATDYnP8 Zy6gJRIN2MH4SgUCooWxZKpZ+9DdNjHKgZ2Nhoyiq8DaxG4Z4Ibv/7vRemAmve85XMuS7KCeOJa vHG+DPUU02qvbddgzOr7Grc0rPMzU8JsuqM7AH X-Google-Smtp-Source: ABdhPJwR3E1pMAnBZJnaPLSWlJMeFjxnELXJQX1BcjRuHKGqv/RLu6FKQBCtyniA016bE2LOtc/RYw== X-Received: by 2002:a17:90a:8a82:: with SMTP id x2mr39055408pjn.187.1638203200437; Mon, 29 Nov 2021 08:26:40 -0800 (PST) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id nh21sm14178848pjb.30.2021.11.29.08.26.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Nov 2021 08:26:39 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Non-superuser subscription owners From: Mark Dilger In-Reply-To: Date: Mon, 29 Nov 2021 08:26:38 -0800 Cc: Jeff Davis , Andrew Dunstan , PostgreSQL-development , Robert Haas Content-Transfer-Encoding: quoted-printable Message-Id: References: <9DFC88D3-1300-4DE8-ACBC-4CEF84399A53@enterprisedb.com> <6BB4451E-7B1B-474C-BD1F-DB7531E720C6@enterprisedb.com> <6A2B0FF6-CC86-48CE-B0D3-5401AA5CFEA9@enterprisedb.com> <1BB0A553-3FE9-4A91-A975-6F9D8C157FBD@enterprisedb.com> <7C62876F-5D19-4B5C-96AC-5590B10A49B2@enterprisedb.com> <66f55a6b9ff7bdd6bfd0d05e8fd8351690e69e23.camel@j-davis.com> To: Amit Kapila X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Nov 28, 2021, at 9:56 PM, Amit Kapila = wrote: >=20 > In ExecUpdate(), we convert Update to DELETE+INSERT when the > partition constraint is failed whereas, on the subscriber-side, it > will simply fail in this case. It is not clear to me how that is > directly related to this patch but surely it will be a good > improvement on its own and might help if that requires us to change > some infrastructure here like hooking into executor at a higher level. I would rather get a fix for non-superuser subscription owners committed = than expand the scope of work and have this patch linger until the v16 = development cycle. This particular DELETE+INSERT problem sounds = important but unrelated and out of scope. > I agree that if we want to do all of this then that would require a > lot of changes. However, giving an error for RLS-enabled tables might > also be too restrictive. The few alternatives could be that (a) we > allow subscription owners to be either have "bypassrls" attribute or > they could be superusers. (b) don't allow initial table_sync for rls > enabled tables. (c) evaluate/analyze what is required to allow Copy > =46rom to start respecting RLS policies. (d) reject replicating any > changes to tables that have RLS enabled. >=20 > I see that you are favoring (d) which clearly has merits like lesser > code/design change but not sure if that is the best way forward or we > can do something better than that either by following one of (a), (b), > (c), or something less restrictive than (d). I was favoring option (d) only when RLS policies exist for one or more = of the target relations. Skipping the table_sync step while replicating tables that have RLS = policies for subscriptions that are owned by users who lack bypassrls is = interesting. If we make that work, it will be a more complete solution = than option (d). =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company