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 1wZLQc-000xpW-2b for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 04:29: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 1wZLQb-00F5nX-18 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 04:29:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZLNX-00F31f-1u for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 04:26:23 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wZLNV-00000000eZ3-2awt for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 04:26:23 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5aa7a7ad475so4547000e87.1 for ; Mon, 15 Jun 2026 21:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781583981; cv=none; d=google.com; s=arc-20240605; b=W1KtBF9vPxaQlfpyDm/JruI9tP3HNbF4KgrsSOoZsr/niNmmsSci2WpTdQdeN94ain mXE9k+L9O/xv6NEYCc9c6sE34yskqREfHtzC4Tzp1qdfK+Ab5vR39n6/nikCyJ8TRQ9J 0yR22mjAa4Ey4gfFUrxM/Gs508atmwLX0bU2wVGMBAjtrVwR2IiCnnLUC8WrMptrgfqN G6hs2NOfbTGTDHRZqg9adKJgE86NlPqZw0BY6xVuhhpFJn+GV72oCaKc6dze6BNfBY6N ahxtnAJK8+qUcryl7ruELj7E4NlONGyd4kxedweov9kJemE6SyQ8m9W4GbMZvrj30nLv LM6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HJhvbNfgXJmrDYiqudJ1fY2g2ORKU2+P8lRnSW7PBdQ=; fh=0AX4g574LOqhiN9dQWGolH5E7qsAPNcRVLE5FhqlYBw=; b=WjI2ikm/W7rtUZm8bvRIqBi641yDD20QgpTM9r4j49KSMZJs620FY6fGl99Om+858U L8AN5jPhAh99yXdBhCmjs7Q3UcGYV90qRU0J/k+IVHPB7moUtUw9sZuI2rW4N8GL/4pG XrT42IvAbp//XNlUPgf5WLU8KJq07QkYxuY3wp9pDYZrDgqDth79KHo0ro4RTBfpPmK2 nOYC6+zCJIgQVNctfDEp74oKQnrDoHPP9bNBuXxYRl5jwei13GlG5DzYgb9zvmCysyu1 b5liT/0jy7BB6p5gUcsq1RBIO33AI1ycWU0IuAMa9qx5JRoC0lzfP6DjCqAC1w7ddDny 39RQ==; 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=20251104; t=1781583981; x=1782188781; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HJhvbNfgXJmrDYiqudJ1fY2g2ORKU2+P8lRnSW7PBdQ=; b=RBuXkkQi2UpcdfM0wa8NQ35gdEUAQk9D+u/NZPShIajMJH97aWux+73dwsTpfNzo/R eknzbjHgO58+FOKqzo0x4ON/rBkNJdmkLZx9ElHuE4UyrlLdPKM3Y9qeypLikNKwLFe2 du05W4ccWQkJ0yVoMPuTVbelyEDoEu2alBJjQXzdYjkJCq906nnEv4wO+zZAyxhKEkD2 oDWWJ6kfj3g89u81uNogWMudM91FPL7UxmtV664x8r5vTVCc5s57OG56MkzP3d4gjnmy qakTtmwXyLOlMIqf3sF9KvQhQ5eLh1zVhAdkU55wOXl13f7YXIMftU+QFcnmEWOfoWJr oEFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781583981; x=1782188781; h=content-transfer-encoding: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=HJhvbNfgXJmrDYiqudJ1fY2g2ORKU2+P8lRnSW7PBdQ=; b=d1Cf0iG5eabQuCUuWLiWea9MnHAS/JJiY/AvFhmwUbwDeg72XKPdu1HCjIrGvN7lhU 4QT1SisheJo84bnvgMr6VAGoESNkaIEWXquWyd38r15c8TwLOuXIOZ+LAulwLUuUC9yx QmilbSqA486xe1HWBWmquqXmnnqObztafXX65oWopLtkrW5nszUbMlb5O+YBxrWbmVFq DTRyBqYqJ6ed2Cl6+9wC+vVdgDl0Pd/A1y39LFo1e+MECq/8CPG8KVPDtLYoUh70MBcm UB7iZ1Rdp5YubVz1ZU8W9woxxo3jN+2BLBg56wI2O/beNH9PHL5DDbv2zC2ghRTD9vjL b38g== X-Forwarded-Encrypted: i=1; AFNElJ8VwC4smgeYnsG1X0E+yR7ZtyWgqjAqb3TRbhdlIylpcj5cCFDbxRghPyRzQAl0/Y8LuR+9Btmx/mZsR54D@lists.postgresql.org X-Gm-Message-State: AOJu0Yy0z4wrnnSBfL8+zjVVs4np9+TutoyffT8i0/waVUgrxAfQLAMe sn8UFOlPrvPRM/gRqVDcIq8LbzI7zxqKLqUp/zWrPJzAZiGMsoKwOLM+y5SlHzr/voKLZ6BQv9L aws1jH2Ay5DQGURdKKmXXVYFZYJ5emf8= X-Gm-Gg: Acq92OFxLtCiGuLxqOXvyDGVP/mh4lKiMh3Tm/Q7sjEKnOm+EebEVjtHy5ply/HUTjR l/QMQ9ZNJ5UKfBnN7fZ55oJLH3LnVEISyjUVc8qgJKN2DWd+cZ2RGWPr3XwqqcgfMWHVAkiaFru i7fYbXoIhjdQZp0kTLF2yUGkWxU8ZbalNvawg5RupI6m/zjAOcmYwT2GpM2un8PcRULWjF5Itbe PCLvhfDlMUpag4eUVMn7ZJl8EAc6dZLITrHrO7U8LT2lHn4mg0JY/sInlSKW7rd/IQep5B9ZNya BZHtASOCe/8KBYtl6R0Enraz1fSbLL/Hj+EW+9GqigaDjUYGXglviQ== X-Received: by 2002:a05:6512:3115:b0:5aa:6b98:7a73 with SMTP id 2adb3069b0e04-5ad2db2c715mr3676831e87.12.1781583980458; Mon, 15 Jun 2026 21:26:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Tue, 16 Jun 2026 09:56:04 +0530 X-Gm-Features: AVVi8CeteRRNw97rGne8pTWS3L8W7SlQ_Q1Y9_dDD0eiKkxiKdfPSUGmchzSVG0 Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: vignesh C Cc: Amit Kapila , Dilip Kumar , Nisha Moond , Peter Smith , Masahiko Sawada , Bharath Rupireddy , PostgreSQL Hackers , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 16, 2026 at 9:27=E2=80=AFAM vignesh C wro= te: > > On Mon, 15 Jun 2026 at 14:20, Amit Kapila wrote= : > > > > > 2. Views are disallowed, but functions are allowed > > > Creating a view in the pg_conflict schema is rejected: > > > postgres=3D# CREATE VIEW v1 AS > > > SELECT * FROM pg_conflict.pg_conflict_log_16435; > > > ERROR: permission denied to create "pg_conflict.v1" > > > DETAIL: Conflict schema modifications are currently disallowed. > > > > > > However, creating a function in the same schema succeeds: > > > CREATE FUNCTION pg_conflict.get_conflict_count() > > > RETURNS bigint > > > LANGUAGE sql > > > AS $$ > > > SELECT count(*) FROM pg_conflict.pg_conflict_log_16404; > > > $$; > > > CREATE FUNCTION > > > > > > > This is okay because the function is doing SELECT which we allow on > > these tables. > > Shouldn=E2=80=99t creating a view also be allowed for the same reason? > > The function is permitted because it only performs a SELECT on the > conflict log table, and such read operations are allowed. A view > likewise represents a stored query definition and does not modify the > conflict schema or its underlying tables. Given that direct queries on > the conflict log tables are already permitted, allowing users to > define views over them is consistent with the same rationale applied > to functions. > I think Function creation and view creation should be allowed. a) Views are purely logical wrappers used to inspect data. Allowing them causes no harm and provides a benefit to DBAs, who can use them to customize how they monitor CLT data. b) IMO, allowing function creation is safe because we internally enforce table-level restrictions at execution time. If a user defines a function that only performs a 'select', it will run cleanly. But if a function attempts a restricted operation such as an INSERT, UPDATE; our existing checks/restrictions will naturally intercept the execution and fail with the appropriate error. The question is whether we should allow users to create these inside the CLT schema or only in public/other schema? thanks Shveta