Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w28p5-0001eu-2C for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 14:21:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w28p3-00APvc-2c for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 14:21:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w28p3-00APvS-1h for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 14:21:34 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w28p1-000000001Vd-02kS for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 14:21:33 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-38a2f92fab4so41155451fa.2 for ; Mon, 16 Mar 2026 07:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773670891; cv=none; d=google.com; s=arc-20240605; b=XIyrdEyDBbGEud9VdsAdv8OTuBiZxQM4tEn7qY/6fSIhJnEZxlrw+uln1jVIl9ZVt4 WQNG9/URFdg4kAwFZE0K2nWtyXc4pbj3N27XVLAhDPJOyRX5dPwNHeAnbZ7iT/ocNmqt KW60glY9Rj2/Rr9BjdrNGQ6UdGkWRQwJUA+uqUxtn6xxBtJxvQEeq68j0ix3uzHaWmdF CAbhhrDZnBzkHKozMKThArc+7E5PdCRvf6UjmXKV2tLBJydFfmtzFYTTCPpSJqmKFJVB vzYNwa1GBcn7Iyb/6690eA+3GPQ5F8XBDLXprKQPyh2qij8SFFkiUYU9EZCCzg3Ugd9S nxsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=xO4ANDL4PEp9pBZUaXeVoI/Rz0oD5qIvBCTG9HNfTPg=; fh=IgLMSwECYhxN/WwPmncSimVywDv3BP02Mv7KGICqgPE=; b=Fe3yStvXm2m4oLxAO4i2kzdNhGZCGnyYPWCEnTHhE/NLJ6bTV/mNnmtK8LQI1cTl/G +ZCKOOIOxer06NT63VXf53uQaLzOkpS+t1wkFztGg+ST1aDUKCcBp3B4bbXMlke9hSHX Nupsqm5GsRniwOgSa/r+9k8E6nhkNsULXex9KmGsjkQZiOyzw7hTGVVu4NMKSFwgnKfq 6U4gfzmspG+x53TWgRfiBFMNtUvZsWRrUPKKnlsSvoGYGKY1EVldy6CSNgnQPUJtVkj5 Zp0VyvpegHuoXM7Ii5NsuCVIw+6/32Bjsb2p77K4pUxHV+nuBxNy8RD3rlGmI9LkM/AE xgWg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773670891; x=1774275691; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xO4ANDL4PEp9pBZUaXeVoI/Rz0oD5qIvBCTG9HNfTPg=; b=QYyvCScg4NLFuZ1BWedSLzR+egOiHCV+37mKLH/I4bSXusCG4/g0hT5tPTBT6xx16g Jl1B+rXqNmrVjbXDzVZM1W0CqWnHcC/AIcvwLXwgUj8ZMrVojyPc2j+XNzxWZMAC3SHt Y0UfH7FIApMo9qgzcOBmFXD6Cfa6O0eKQkZBOfgQ+BSAPHxAUk/SoDUSiBenkLqLlspI Lnr6pgFzw73Bc7pLRVftulFbjHbrvjtgXCisaFFMGJ/PWfdDBj5AEsGO3L4iw6A2FB6v jOH43TA1N6S0wFKoGajkt0R9oVBi4iz2/Vsz365+QBiQYGZfUQIAUljwgnSm3f8Jz4fS uCZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773670891; x=1774275691; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xO4ANDL4PEp9pBZUaXeVoI/Rz0oD5qIvBCTG9HNfTPg=; b=MfzJCcv5jkMu8Pb75vH7gYaMt3gYLlhzeDB2Hb8lFzgreJKhH0hnBKNIFr+xn3Ie3a vq235s3QltALEqZKcu83JCrXnboofsTrfJD+GEVFI+iZqgSUd9kPaeSHj9ra2klA96Mo OaHy+vHfg0cqfppgHMpIQuO5zFb6PX/XDxXeijpyZSZ1zD8kmz4CxpILB4E1L/gCQyYe +wlf1mPCthyMw+cJyuhMjs2ifYr/8UiNBCSDS2jemVss5eOJwlZ697uixtN49KdKJU5N mLN/GTfyRTkj6H/yxznKiNu4NrIphO8LqGVkvdNw0BPevTC7wOqGDF2D1JAcRVwZ1Wvq 2XLw== X-Forwarded-Encrypted: i=1; AJvYcCVcO57uhX5UPp3nJDZ/O6WT+q050SQI+Dr3Iz/rmUmBzLzce2B5qwGULO0v1KhOnbptEFV+2WfT/korIWnR@lists.postgresql.org X-Gm-Message-State: AOJu0YyVMLCcJp1vGD/eYLI3pcvznJDxsY0scVhyIr/Hc4o+evNCFeIx Co/s0jqLwykkYYYi0aMvgL/CCYM1bSDCfDgB3muFxaUfe7sW/HzUE3iuVMocOccXcQfUScaNSXX GXlXxddY/diLnIOwMgk1kWrCP3f/W2UE= X-Gm-Gg: ATEYQzzGvRsvtimmpSLtIw7HwpWtXet2zx8aG2kYWt1ORGJ/FDbJOa7cwL9x5/6RNid Q6wK45W1zc6S24xi3pPpO5SB3TQDzX3O5nucrj9v/71Ej4vyrKC0rbm4ljFzxTICyeMdOY7IUxh A4ER+EmAi56CWn69IEtohte/qyWyeWjuohXUHaF+jfASQY6fK2YBIN3LcAXyG73V3nlXUSVEv/A mUlQkgHyZS3eZC+zHnFXqP4s/8Di8UaijN+SE2PEDG3lKS9B9ctpRzt856bbtxys4qu340Q0UmG T6tC6sMTEXa6Q6YWVZhbyVJC8ojVXN2o51R/q38ifro3mCqogQf6+i+wPAJgC7LTPt5JGaKFyqh 97cat X-Received: by 2002:a2e:a593:0:b0:386:eba2:5b39 with SMTP id 38308e7fff4ca-38a897bb768mr43675511fa.22.1773670890526; Mon, 16 Mar 2026 07:21:30 -0700 (PDT) MIME-Version: 1.0 References: <22068.1773652380@localhost> <202603161220.7nv6whwu33hi@alvherre.pgsql> In-Reply-To: <202603161220.7nv6whwu33hi@alvherre.pgsql> From: Matthias van de Meent Date: Mon, 16 Mar 2026 15:21:18 +0100 X-Gm-Features: AaiRm52P-fqwF8DcpKMaOCHm90kfSkjRXvFvjvBfQVegLRoya8L8n3J8JMETuKI Message-ID: Subject: Re: Adding REPACK [concurrently] To: Alvaro Herrera Cc: Antonin Houska , Mihail Nikalayeu , Pg Hackers , Robert Treat 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, 16 Mar 2026 at 13:21, Alvaro Herrera wrote: > > On 2026-Mar-16, Antonin Houska wrote: > > > One more problem related to the replication slot is that, due to the call of > > CheckSlotPermissions() in setup_logical_decoding(), REPLICATION privilege is > > required for REPACK (CONCURRENTLY) to run. That's not too user-friendly. > > > > I think the reason to require the REPLICATION privilege is that, in generic > > case, the output plugin can access data of any table in the database. However > > REPACK uses one particular plugin and that plugin only decodes changes of one > > particular table. Thus I think we don't really need to call > > CheckSlotPermissions(). Do I seem to miss something? > > Yeah, I don't think it makes sense to require REPLICATION privilege to > run REPACK. I don't think it makes sense to allow just any table owner to modify the effective_wal_level GUC; which is what the effect would be of removing the REPLICATION requirement from roles that want to REPACK CONCURRENTLY -- and in doing so create logical slots, which increase effective_wal_level to logical. Creating a replication slot requires REPLICATION privilege, because it consumes a (possibly very) limited server resource that can't be increased without restart and because it impacts other backends' WAL performance through effective_wal_level. Allowing users to consume said resource without first having the appropriate permissions makes this flag practically meaningless. Note that most of my argument hinges on the impact on other, unrelated databases/tables/sessions. Replication slots have a hard cap defined at startup, and effective_wal_level increases the WAL generated by practically all backends. If replication slot counts were SIGHUP, and RelationIsLogicallyLogged() returned true only in databases with LR slots, and only for the tables actually present in publications, I'd consider this much less problematic. However, we don't live in that world, so I am opposed to allowing table owners without REPLICATION to take any/all replication slots. Matthias van de Meent Databricks (https://www.databricks.com)