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 1wZ31m-000jMU-2I for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2026 08:50:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZ31l-00AfhU-1p for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2026 08:50:41 +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 1wZ31k-00AfhL-36 for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2026 08:50:41 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wZ31j-00000000Rud-2CPO for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2026 08:50:40 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-c85a297d2d2so1883870a12.0 for ; Mon, 15 Jun 2026 01:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781513438; cv=none; d=google.com; s=arc-20240605; b=Zrpn8SDFKxY//7C5imxtKp1HeS4DA9dToZg3JKcwlUI1R1ONVnG2+au6NBj4Hw8Xjc bZoGmLGUgEdz3U91sM7p8mzDKTBQpSKXOE8JRv8sR2CD00VboARHedcJjxuQhLhO6NSz eFHP5Dlcr+D+ta/w5eLXyXY+9xihH/YMt7URnguoZn0l6fGZ0mPFXHRC2A/TQCznkIcz NBhEk6Fsj+sXvdZRZWmny2RZI4wtWP1LJAS8dh3+c8/GfoWKwjReBCsLHjR8l4vB5FMQ fctGiOhGRJWy1BmxIO3ehx5RU564XMZep5RLeoBMEWwSaD/Gb9Lz1Ef68jF8IJozSZV0 QKQw== 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=QK55tu2JstwfF2sLrd72HfKauIM8HnSyiTK7RC92kn8=; fh=duuQmo0airv6v7q0N3+VvY7dd/paF/xL8FLGTwK8bPY=; b=kftz71OvxZxwxiGI4Xrjb8n97AdGh7cZrTlIGLurdc6mxbw5+rbfHj9dMH/SSAHIE2 TRAlDeT4KkBPU45lojUusmIfnKvjVFw1YKgIJXWVQ2pbbJ6OYKhJTYh97GfAskwfM56q Ruqvj3Tkk0XYszWAjzfsHBK5NEn4FcD4G+jDPi+EbjvG0jTTcb/AVVUcrlrGuY1K9yL4 4UyP+vPT48k2mPUaOhVseBu2YTHmll0LeI3ScqDLXR7uFdn3nUuHqdaZe/jEnSLhW3A1 XfniM0UxZ/wHN1yAcGvX/kj6weBjVC6DmHoAYYvB2byRJwCydRZ0Z5AOIKwdVagmqeRV P+gA==; 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=1781513438; x=1782118238; 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=QK55tu2JstwfF2sLrd72HfKauIM8HnSyiTK7RC92kn8=; b=YLBbYAe61C1BkQVCKSGSYYmNnQE0M4Ln0ChUhOUy8xNL2NySMh6+SLpf5lJ4GkAkk5 3I/+jsKL3FiA1/nrYhWv/oDz0tNYuZbEzKOni4HBYuSCz2cVO+QTIYathO2hFiZChraM Ocr/Wz/QWSnT8RjR6SuTGa206JImgZX/SRxODSWBp0TTGUk/fPSCWFJz1mVKpEyna7sr aNRzA9AzjugQvpAid31U5VMlpewQ7/O8x5xN6JWb+PTWbGJd8DeVbTZhLqwxha4NLqnI OlAY+y/bY9bXLvXe/JLLhNjH7QZLfrcHoKzbLnVJ7HA/7qapgEKhXC8ZJpekNDF2OSBT 79lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781513438; x=1782118238; 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=QK55tu2JstwfF2sLrd72HfKauIM8HnSyiTK7RC92kn8=; b=HCmTBe55oyKUWhFWr3QHoL4QaXwf6GOLYCZPUgYATm0v5ZvvQdT4cCOMseZRVMP2iL 9JPOOVfBHHEekiW/sOtCgwdpQDOSRpbTPmE+LWFKWnr1ywDnmE+WvuuAUPAXGoL3WuBM nXEEeKWJ+bs+Ay94yHnJ/CEBuxHEU3LBg8IWbAFUYM/lgSlNNV2h+PYogif2LvI0Cpvb O34L/tbzJn9kEcHtL3aGnUsVKf125gb0ZXgAiegkbTXWrhleyl9Gn/A5KG2+H1efVO7s dMxWq5mOgapsEJV3a7D/hsKYKFc3LoN23OWb6dgSTp7paEpE1vWPMP4pRPIE2SvRnngi XXGQ== X-Forwarded-Encrypted: i=1; AFNElJ/oVf+z2fFeeMvbEVsqAOCBK8mzWkYCVEd9F3fa0IsxxeLu5tUz38Oi+rWrPGG4xyZ5ZycOEPcJTS8fVfR0@lists.postgresql.org X-Gm-Message-State: AOJu0YwuWCm4prq3k/8Moh749L3W52GBnsjzecYXqJMK0+hJW99EjDPa xZtS8jVK3U1knNcRJ4eQpI1iXYADWPe5p9ALtYMQdZQsBLA++MpvHfcdnvBWVb8eJI6s8As4xCY gv18+7HCid6LHFJji9XSaCNEAo5sZDKE= X-Gm-Gg: Acq92OFfCrk8l8H0HCoG4tZj3YTVjW5wXjJnfOY98dUExwJIzv758HqebQCY2G3OPjR 2GmoqtOXnOpFQvzyPaUeBnhPY43zXW/+UjIyGIyNgh2ynFDI5U04TQ2MLvFJmw2Ptqh8vxlfsbb qH1BmUDTVCrRPcrK7SsXVDyGviD4xIemvK3DiCXFiAJek7zOU1Ine84ndLUq8JAc2bAMk2WmdsG 3BwJ4UGisrxF1vVcUkchhEj3OBpBbEm3EVI4NmWEj/frYqt8N6LnheixuAtHG1tsHAghzh40bMs X7tbQwCCjzu/41hBQRZjYcVyUX+o76Qwj1RIAhUO8nUhF4+YXHvPMiS2Gs+ymXFY/nYyIfJ0/Mt s7sRd1RZGKl8CPnVqjg== X-Received: by 2002:a05:6a20:939a:b0:3a2:ebfc:6bee with SMTP id adf61e73a8af0-3b78407114amr14772087637.41.1781513437872; Mon, 15 Jun 2026 01:50:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 15 Jun 2026 14:20:26 +0530 X-Gm-Features: AVVi8CdxtMUcDQGdYEfrof6WWVYfQwljMZcBwCmMkuWs_79uswNwxv28JzmvtWQ Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: vignesh C Cc: Dilip Kumar , shveta malik , Nisha Moond , Peter Smith , Masahiko Sawada , Bharath Rupireddy , PostgreSQL Hackers 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 Mon, Jun 15, 2026 at 11:57=E2=80=AFAM vignesh C wr= ote: > > While reviewing operations on the pg_conflict schema, I noticed a few > behaviors that I wasn't sure were intentional. > 1. REINDEX is allowed on conflict log tables > postgres=3D# REINDEX TABLE pg_conflict.pg_conflict_log_16404; > REINDEX > > I was not sure whether allowing REINDEX on conflict log tables is > intentional, given that these are system-managed tables. > I think this should be disallowed. > 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. > I noticed similar behavior with the pg_toast schema as well, where > function creation is allowed: > > CREATE FUNCTION pg_toast.get_toast_1213_count() > RETURNS bigint > LANGUAGE sql > AS $$ > SELECT count(*) FROM pg_toast.pg_toast_1213; > $$; > CREATE FUNCTION > > I am not sure what the rationale is for permitting some object types > while rejecting others. > > 3. Functions can be created, but triggers cannot: > Although function creation succeeds, trigger creation on a conflict > log table is rejected: > CREATE TRIGGER conflict_audit > AFTER INSERT > ON pg_conflict.pg_conflict_log_16435 > FOR EACH ROW > EXECUTE FUNCTION get_conflict_count(); > ERROR: permission denied: "pg_conflict_log_16435" is a conflict log tabl= e > DETAIL: Conflict log tables are system-managed tables for logical > replication conflicts. > > Again, I wasn't sure whether this distinction is intentional. > I have given the reason for functions above and this restriction is okay. > 4. User-defined types and domains are allowed > CREATE TYPE pg_conflict.conflict_status AS ENUM ('ACTIVE', 'INACTIVE'); > CREATE TYPE > > CREATE DOMAIN pg_conflict.positive_int > AS integer > CHECK (VALUE > 0); > CREATE DOMAIN > > I was also surprised that creating types and domains is permitted in > the pg_conflict schema. > > Overall, I am having some difficulty understanding the rules governing > which operations are allowed and which are disallowed in the > pg_conflict namespace. If these behaviors are intentional, would it > make sense to document the supported and unsupported operations more > clearly? That would help avoid confusion for users. > Ideally, we should allow only SELECT, DELETE, and TRUNCATE for allowing users to view and maintain the CLT tables. We are also planning to allow the LOCK command for the purpose of pg_dump. --=20 With Regards, Amit Kapila.