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 1wZRFK-0012T7-1p for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 10:42:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZRFI-00GoLY-1n for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 10:42:16 +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 1wZRFH-00GoLO-33 for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 10:42:16 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wZRFG-00000000d0Z-2DqQ for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 10:42:15 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5aa7a7c9711so4906666e87.0 for ; Tue, 16 Jun 2026 03:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781606532; cv=none; d=google.com; s=arc-20240605; b=Ojs4lYlehPOqS89mqw+LCt9PLYYstide595v9gJi7OaTZUDP3uWRWVk7E88aj6qa/l 78oO9xBopa6rVwu6iskX7Xi7z6Oh/SO4lMR8q/FLMDd5Le/ngMnfHPFN/F0zx3OGmzSV U5AkXH3hK63EryK/YPZQ386xg6l/Rln0lZwWZ4m3d+yydC2RkX99z0fGGFI8NYVqu1Ts yfQb0vXzOpxbOzKYkkT5ih3W8CaVEB043qDf1EeKh8oSNQ/mzirDWGElS5ZegIOKuoPo PR4lE4NpRI9fTuPSLazSvrlpL05LlWxac38qCYyQMmZq6SZqAQDGXvtUc2eNMKbxKR+m grug== 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=f0Y+u/lGlaBwW9PjEjgfr607kAbJL56qXYOHw636QXU=; fh=JBIAlEdOjOeC/EBRWEZK7Qz+g/V5gn6Txg86Cd18/UQ=; b=bxUCRUBE6GdFkDkUXoZIw05T8c6s0n0RLjHuTWYW2jnLRez6+0/V4e8VQH7LJ84pry WtBjCtNDnKrMplT4pVaIa8g8sg04D5bA+6/H9j5jZdhScj88xxlwTM+mlltIZHhGxbjp 5yxEbKzkONp8KZV+1VCgfpxiHEITWm653hM7AbhRBC49Qm3bK9rgrCrXbtNhHk6VMNEW iI7QOmzhAnMoiGK7ry4RSPk9M3hsWtCKl/BelBbNcd9oyqgXSC15+xrsWJtu3FlKl0jE NzXoGZrJQfUGBH5WZD06caMfLiMVDDVwZ0od01IMbZroibS7d/Pw7TAUbnAhFWjhi7lp fsFw==; 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=1781606532; x=1782211332; 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=f0Y+u/lGlaBwW9PjEjgfr607kAbJL56qXYOHw636QXU=; b=shktO0vWJXs/H0NPe6wXvMssd1ysO0iUpXRnuXkIrjv28n8WDFK5+iC4FYuOPN64w+ vwSYYSx4qnadVjuzPg5tjxuu71Dfl5YDUvPEshhbOrMdMqhvie3xknSMGDE5rhK5rg2V xdiBvQRmRaLqye3orQolEbjzjqp9vywNubPwoMgIMSgjSFM6nElnkWSjB/h1BNlpdFDZ iffXO3q6JWvuHEUqrETZEP80kfQws9jEWW37PkhI2E8m5uAQ7HABSs8eKRC+0X4dgZ7J AvDIX4YteFVWdYRFdBvQ6kYcKy/CEdNREoXFHt6IlFhLkzacg1bwHQGnT2BsHLN/fjyv KFwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781606532; x=1782211332; 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=f0Y+u/lGlaBwW9PjEjgfr607kAbJL56qXYOHw636QXU=; b=pM9SZNusgGAxQ4NUJqBEB6QBCFMBDbaa3spXmRLZtsnDr2jv/emzKszCn0TFQrA5Vd eqJ2Sk8YhiHhHoqcwE2icJeTqKjZ0O/tqJlwCr3x/bjXK0OaiyGDV3wp6ES0jEX//fZ0 jnuYrzmgl4eTYxql/wwLTtsTaScwWyM7MtX3LV8CXRqlP+a+2meJDM6WnUQmzt1arkld 58iCqgIxfRVYQyb1L5DIOZlXdg3lgLb1cLSXXr2HaYb3fqH+rVvp3Uny3qxx5jxsWZSh cS3f3huLAg/dXH3hQpHWiFtdQTAQ7dqkliBtEPH9MC2Hqy3/PppGftz+cCnTPRFkOC8k bwgQ== X-Forwarded-Encrypted: i=1; AFNElJ8hxernjLJrGN4VmPiRtuJkIGhhXKkWwtgBlTKzpbB5ObtViUQBSqc5OidpZ3u1p+EsFCTZhpaEfE0woeNM@lists.postgresql.org X-Gm-Message-State: AOJu0YwR9ASscbBuFtdG9dhshsqTXdqIuOhPNF4m0R038Sq2GNjWwjsB QVRQrEH2OOZXrcwxQYQjLyQ+cy2pkqnU+C/i8oR2l1WHCTmHDmDU3r3/6W1MLQsxTPXC7LzZUxS YBP0/MgUFuKp31dkqoH7uVFifjuKXtFM= X-Gm-Gg: Acq92OFPgTI6WmIi+PZ5T1wwoKqvgfVHkM28SwqjfyV0n/m1AhBf18UbiJmmxoxN369 zPXJjjrhz7Q4yNGeInhLneI0gxSSUMV3vTpnzSdJcliOM1Q/p/VdloeMcKwP0DSmdoj5gELniCX qDLx1TRz9cAg5DXxlf4IpyYp7cU9cnSmKBwE2JNvKZ2FqqKIbIt7YeqoDY+6mbJZ8R5P0ma9jMQ MQq437Wi3ZCNWNQlGlsbU/6xk9/cf1PffIaHe6n4Wplx3oc89nGvi3kzSzGVDCUA0TWz4meIIx5 Kr+Z5/CWAnnMIximw15n+EnDdFVRANmvuiV4cTF9CKRBMMMs5A== X-Received: by 2002:a19:550e:0:b0:5aa:6cfc:a222 with SMTP id 2adb3069b0e04-5ad42b7d369mr681921e87.24.1781606532256; Tue, 16 Jun 2026 03:42:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dilip Kumar Date: Tue, 16 Jun 2026 16:11:55 +0530 X-Gm-Features: AVVi8CcGVsDrS4O_LEcjWWGzd5l9yBV8tzemqk6vpS1SvlR9hZsxmBn-TDVZuKc Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: vignesh C Cc: Amit Kapila , 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 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. o ensure we are aligned, I want to clarify the current behavior before we decide on the next steps. Currently, view and function creation are both permitted for toast and conflict tables. However, there is a discrepancy in the schemas: view creation is blocked in the 'pg_conflict' and 'pg_toast' schemas, while function creation is allowed in both. So IIUC we need to take a call whether the function creation should be blocked in pg_conflict schema or not, logically we can say it can be blocked but we might need to discuss on this because it's allowed in the `pg_toast` schema. And if we are worried about the descripency that functions are allowed in this schema but views are not, I don't think we need to worry about this, this is an existing behaviour for toast also and if we want to can investigate as a separate thread and fix it for system schema al together? Am I missing something here? postgres[2205601]=3D# CREATE VIEW v2 AS select * from pg_toast.pg_toast_164= 12; CREATE VIEW postgres[2205601]=3D# CREATE VIEW v3 AS select * from pg_conflict.pg_conflict_log_16406; CREATE VIEW CREATE VIEW pg_toast.v5 AS select * from pg_toast.pg_toast_16412; ERROR: 42501: permission denied to create "pg_toast.v5" DETAIL: System catalog modifications are currently disallowed. LOCATION: heap_create, heap.c:322 postgres[2205601]=3D# CREATE VIEW pg_conflict.v5 AS select * from pg_conflict.pg_conflict_log_16406; ERROR: 42501: permission denied to create "pg_conflict.v5" DETAIL: Conflict schema modifications are currently disallowed. LOCATION: heap_create, heap.c:329 postgres[2205601]=3D# CREATE FUNCTION pg_conflict.get_conflict_count() RETURNS bigint LANGUAGE sql AS $$ SELECT count(*) FROM pg_conflict.pg_conflict_log_16406; $$; CREATE FUNCTION postgres[2205601]=3D# CREATE FUNCTION pg_toast.get_toast_count() RETURNS bigint LANGUAGE sql AS $$ SELECT count(*) FROM pg_toast.pg_toast_16412; $$; CREATE FUNCTION --=20 Regards, Dilip Kumar Google