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.94.2) (envelope-from ) id 1v1pq3-00D7YS-U4 for pgsql-admin@arkaria.postgresql.org; Thu, 25 Sep 2025 17:33:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v1pq2-004IyK-Li for pgsql-admin@arkaria.postgresql.org; Thu, 25 Sep 2025 17:33:02 +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.94.2) (envelope-from ) id 1v1pq2-004IyA-AF for pgsql-admin@lists.postgresql.org; Thu, 25 Sep 2025 17:33:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v1pq0-002P5l-0w for pgsql-admin@lists.postgresql.org; Thu, 25 Sep 2025 17:33:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 58PHWtEX3825125; Thu, 25 Sep 2025 13:32:55 -0400 From: Tom Lane To: Sam Stearns cc: Pgsql-admin , Dugan Kniesteadt , Henry Ashu , Avi Vallarapu Subject: Re: INSERT Permission Denied In-reply-to: References: <3772273.1758819489@sss.pgh.pa.us> <3773384.1758820097@sss.pgh.pa.us> Comments: In-reply-to Sam Stearns message dated "Thu, 25 Sep 2025 10:15:20 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3825123.1758821575.1@sss.pgh.pa.us> Date: Thu, 25 Sep 2025 13:32:55 -0400 Message-ID: <3825124.1758821575@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sam Stearns writes: > csbstage=*# INSERT INTO treg.cd_combined_office_mappings ( > csbstage(*# tcsi_office_id, combined_office_id, sb2_account_id, > postal_code, category, > ... > ERROR: permission denied for schema treg > LINE 1: SELECT 1 FROM ONLY "treg"."cd_combined_offices" x WHERE "com... > ^ > QUERY: SELECT 1 FROM ONLY "treg"."cd_combined_offices" x WHERE > "combined_office_id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x > csbstage=!# rollback; Looking closer, that's not your original query: it looks to be a foreign-key enforcement query. That'll be run as the owner of the table (I think the owner of the referencing table, but I might have that backwards). That owner is what is lacking permissions. regards, tom lane