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 1ms1db-0002QF-3t for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Nov 2021 11:49:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ms1dZ-0005H0-4M for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Nov 2021 11:49:29 +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 1ms1dY-0005Gr-PK for pgsql-hackers@lists.postgresql.org; Tue, 30 Nov 2021 11:49:28 +0000 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ms1dW-0001uz-Gw for pgsql-hackers@postgresql.org; Tue, 30 Nov 2021 11:49:28 +0000 Received: by mail-yb1-xb36.google.com with SMTP id y68so51818937ybe.1 for ; Tue, 30 Nov 2021 03:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GOr+0vVTyjG+q7xUpyrb0I3lZGGdE3aASIfsnKhxPbk=; b=YD0SnUv4nw61raxqvDTBQzUKnEvI2DE9uD+Ksc0gsQqhG6i9iscPXPB75NzQOl7ASW ksaZxicp13mdp1uenx6RF0+UKQ2hnDBRM6BPqCd1C2GWlP4n+bYyg2y9HaNNs5E/F530 rDAbIgJFnh+e51ZZHFaL9ogyRYoA8xntXItObHeSpKXSC2fMVS3nGLolZNJDYjmKXU9a 90manbpeyDbnpSaoqpxiAKzO2xleizKow3xXTDY2AzvZwKMetVGzLuq61h99vc6zmYS0 8V7iBco49kUqINKqps/Rc6is15OFyuxZ6/+asdfA/+vM1JxF65BpkFZbgmLPE+kiL8U2 FtbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GOr+0vVTyjG+q7xUpyrb0I3lZGGdE3aASIfsnKhxPbk=; b=rs8k+dzBbVuQISGfCV4J0UucVA+DaMP7vg6+3vU8LdKrCxJzBsoJhB5NAPI5q4pZ7I 8RgmdDwx3Ffe7RyA4+N6d19dce/TR6/JQ5L5/LKEJLtHVLRJX8GMwzRmuOC6V2GmQz8I BtweBM0YPVzAWH1fjpvlv1+vkKwjTUkHIeO7qm50bOIVrn005PxrvTpeVxHjDVR/UuEW yq8f+pOG9EPo5aDrn8yKsbMLA/Yl5fy0M5vIxIai8IEmRZCOgCjv2nkPS0ToAcr5B+Gk 77LcTdbE3oQHqgi5IZxnSE0Qx7G7agm6tVsxA+Qj3B36wf6zjwtBYzlh9k1/nuKgrujI z9HA== X-Gm-Message-State: AOAM5322NuEObadEwKjgsFWQiPVRXRlwVn0Gtx4wXBsnPGFyXmkDZZOU JnoDUDDBerOenVh/Q2f9KBq8NQks19qqFePSXw4= X-Google-Smtp-Source: ABdhPJzANeRidSpkfL8XHUxej1BfnaHk1AdQRfGpWXNUpKcVozu1ULlzKnUBxNf93KVPDTqsjIQSN7yqb4H+pPp1Md8= X-Received: by 2002:a25:2bc4:: with SMTP id r187mr12274945ybr.635.1638272964510; Tue, 30 Nov 2021 03:49:24 -0800 (PST) MIME-Version: 1.0 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> <5c99a2687ab1985f62c503079a15f92051054efe.camel@j-davis.com> In-Reply-To: <5c99a2687ab1985f62c503079a15f92051054efe.camel@j-davis.com> From: Amit Kapila Date: Tue, 30 Nov 2021 17:19:13 +0530 Message-ID: Subject: Re: Non-superuser subscription owners To: Jeff Davis Cc: Mark Dilger , Andrew Dunstan , PostgreSQL-development , Robert Haas Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Nov 29, 2021 at 11:52 PM Jeff Davis wrote: > > On Mon, 2021-11-29 at 08:26 -0800, Mark Dilger wrote: > > > > 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 > > > From to start respecting RLS policies. (d) reject replicating any > > > changes to tables that have RLS enabled. > > Maybe a combination? > > Allow subscriptions with copy_data=true iff the subscription owner is > bypassrls or superuser. And then enforce RLS+WCO during > insert/update/delete. > Yeah, that sounds reasonable to me. > I don't think it's a big change (correct me if I'm wrong), > Yeah, I also don't think it should be a big change. -- With Regards, Amit Kapila.