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 1mrlIm-00088D-Ki for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Nov 2021 18:22:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mrlIl-0004Er-Gc for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Nov 2021 18:22:55 +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 1mrlIl-0004Ei-1x for pgsql-hackers@lists.postgresql.org; Mon, 29 Nov 2021 18:22:55 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mrlIi-0001uH-SA for pgsql-hackers@postgresql.org; Mon, 29 Nov 2021 18:22:54 +0000 Received: by mail-pf1-x432.google.com with SMTP id g19so17772714pfb.8 for ; Mon, 29 Nov 2021 10:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=2qm5TWrvhA9qa+eGSVNYKzZjckpbjsBbi7CEh9qyK3A=; b=rcT3g1VRtSgKBTTvSxxW7CYxr68i+gDaLASsgTntMrj7dKZ6UitPXzzbU6gkd0fLf7 LhEoisldOZ6yjOz+InJJ9JYs4kQXMPp/YC2wy7hbv0FyFkUVkReIB0Fs1pzTBid1VNzJ x6jHTFv71COdEZnTW3iZWtVwwtD4AfimcUFiK/Qi2jBll+Uq0VzS23C5t8SBAMMYuCHH GclwxUSkSIf1x1LVp0hZ3+gKg7jTv+u6WflXCRPP43t/eoagaH9P6/0N+YTZNEIfTDVY BUTiGpb3ihBkdzB9kBZtMIko5vZNwh/OQ374WyhvAou62UPuzyMMDXe+owrtklK6Ebdd ho4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=2qm5TWrvhA9qa+eGSVNYKzZjckpbjsBbi7CEh9qyK3A=; b=1Xt4xpOXNSh2QU3I3lu6RDIcMgCSXJyhij3C+7mLgcDbliDNKJEHUhSlWw+u76O90r cQlondl4QuqPoLyqyGIGmzbXhH1C3RCOKLf4n3/brEiptJvwusjsKr4IEiX06w75TQod IigJ6iYuWDCXv923e9w4lF3SqpSAGGV5ISACc3Zv2LAbwzvqWlSwWO2df1BsawlGtdiU A2ZQOJf8EvAFief7fLTrXinjEz1iSwPkijyKKeeWFHXKOMKmUbqE1/mM3RCoeO/e7ETg X0R95PM9ntEGWFN+jAh25cpuo7t4/xpJPHFsYwMdlScliuKM6M4pn41ESJ8UVTSU3ATC tuqg== X-Gm-Message-State: AOAM533C+qg9zZGUx5y3lf1ZYFZEEFs1WQumIUg4t7biDgivqoUxY/IA cZrPQDBiYzagLhisu33fCfCy9Q== X-Google-Smtp-Source: ABdhPJzR6V2OtRabjJZS5qZmfoy/BgdDVhjgeCsp06XEVOB2yB8LcIWwW69a5crOtYOZMO5Upo9YeQ== X-Received: by 2002:a63:5954:: with SMTP id j20mr2396759pgm.365.1638210169937; Mon, 29 Nov 2021 10:22:49 -0800 (PST) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id f21sm20229593pfc.85.2021.11.29.10.22.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Nov 2021 10:22:49 -0800 (PST) Message-ID: <5c99a2687ab1985f62c503079a15f92051054efe.camel@j-davis.com> Subject: Re: Non-superuser subscription owners From: Jeff Davis To: Mark Dilger , Amit Kapila Cc: Andrew Dunstan , PostgreSQL-development , Robert Haas Date: Mon, 29 Nov 2021 10:22:47 -0800 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2021-11-29 at 08:26 -0800, Mark Dilger wrote: > > On Nov 28, 2021, at 9:56 PM, Amit Kapila > > wrote: > > > > 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. Thank you, yes, that's the more important case. > This particular DELETE+INSERT problem sounds important but unrelated > and out of scope. +1 > > 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. I don't think it's a big change (correct me if I'm wrong), and it allows good functionality now, and room to improve in the future if we want to bring in more of ExecInsert into logical replication. Regards, Jeff Davis