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 1v1rBj-00DN22-Qa for pgsql-admin@arkaria.postgresql.org; Thu, 25 Sep 2025 18:59:32 +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 1v1rBi-004rCW-Gm for pgsql-admin@arkaria.postgresql.org; Thu, 25 Sep 2025 18:59:30 +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 1v1rBh-004rCO-Vl for pgsql-admin@lists.postgresql.org; Thu, 25 Sep 2025 18:59:30 +0000 Received: from mx0b-0039f802.pphosted.com ([205.220.176.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v1rBd-002PnB-2k for pgsql-admin@lists.postgresql.org; Thu, 25 Sep 2025 18:59:27 +0000 Received: from pps.filterd (m0209982.ppops.net [127.0.0.1]) by mx0b-0039f802.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 58PHP5AF1753777 for ; Thu, 25 Sep 2025 11:59:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dat.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=ppdk230404; bh=alIGNNKpS8BXkOYSKc+ABHN CGFRDyBXgJCTPdvwbIDI=; b=uW/4NibPFB2TbPKhO39ouEC7Zwc9o0+JxJeIlhc dVhjP7i6gF/sFSC9DIhe5L5cIKxa1G0vzW02hSyvIiHjjWW7DbldD0o2MK1RdASU glQxKtP4RI2/aeqqvbl+Uct4t7ZXCZDrpiXOG2KoaGWTFyoPs9CjTlpNvkv1HifH yJlWL2n0Lql7mMkaQ5vyafkv142UUPXH7+GnDVblGzkkZa/dOCWm5ZxTWIvH9avh U+Lh/yKtUgfIY/karRl1E61/5QCekl6/kWbbOEMvyE/B46XYkl/XIYQO0GSh15Sq 6NbLkS/wez6Oq7YfyFn5HN+18Lgmni1/VIPnu5/in849ovQ== Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by mx0b-0039f802.pphosted.com (PPS) with ESMTPS id 499td1qu81-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 25 Sep 2025 11:59:24 -0700 (PDT) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-b07c2924d53so116849966b.3 for ; Thu, 25 Sep 2025 11:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758826762; x=1759431562; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=alIGNNKpS8BXkOYSKc+ABHNCGFRDyBXgJCTPdvwbIDI=; b=hvfCMaHw10sFlVgf5o7QRmOiR42rEaYy2hFjzRSVwyYggzdyHuQPwbIsa4Ox81cu84 4iPfWdLmNuMgtOzI6rH2lyMgGfMhMJs5qJ3Z/s32lKB0LJzAxlHoa/1T989A7zb2teKs iopSMJ7q3zavzLkG/IiZuGqipj3W1K3JRE21p6Nr7e2EEebCutUzEBeGAFlikx2MyVNt jmyXXoGZDLwmnL916DB5v9Oj/gPWtlxVF0LRVlUum8VAIJeOU823d9lOYjGEYXQO9KPf 5vL8D0vWUZlf+D3EAlHo1oGe3IXeUmA4DJXN1NtJpkiARvaz+f5JKuvddSPtTbsJZc99 nf9Q== X-Gm-Message-State: AOJu0YyF50Q3M8AnQcY42NRo9jwMi0zzPQgQRFBz+AsnW0MpT+NBKw4c N/INQi2ukL0QegWhQE2+8qFRzqUku2s4jq+PNq/Za1tja0lZDg4JkD8DlxGIn9IYm/laKHpa6TO f8g6g0pNRWoNNJcripAF3I7sEn9KNlcEcbq5Q5ensASRyE4pIrMlZZhF2XSo9mHWilUz5w/mK7Z 0RoqVSq0wFW8zTCEOBGMQyWnXnHTWN8JIHnGeMxujZTtaT0ro9i79lANKpouHCGrFgu0VbupYxH /qaAcY= X-Gm-Gg: ASbGncvByqaNl6IWEIsYMG+83MR2moJ1ilGyaCPwNxnZ2/5wYEM9LRIAkWolwB6Ge9L mSB3xdC+mt8lCY5VkdPHNUGQjEhnkrDHLpXAeFx1GovCI+Oed/Y2GNXMo9EMlyFtw1/NDeW2igH wKfdEFIvJVcpmD4zeRK5o= X-Received: by 2002:a17:907:3eaa:b0:b30:852e:bea with SMTP id a640c23a62f3a-b34bd62cd56mr495446766b.63.1758826762103; Thu, 25 Sep 2025 11:59:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9nS0kZxNeeWGn+q8RI8X/g2DC9Q0A/XBHpb6nABDjFT2k8uSubRdMZotCE/NqBn0L1GMNcLoA6EQefCwk27k= X-Received: by 2002:a17:907:3eaa:b0:b30:852e:bea with SMTP id a640c23a62f3a-b34bd62cd56mr495444466b.63.1758826761690; Thu, 25 Sep 2025 11:59:21 -0700 (PDT) MIME-Version: 1.0 References: <3772273.1758819489@sss.pgh.pa.us> <3773384.1758820097@sss.pgh.pa.us> <3825124.1758821575@sss.pgh.pa.us> In-Reply-To: <3825124.1758821575@sss.pgh.pa.us> From: Sam Stearns Date: Thu, 25 Sep 2025 11:59:10 -0700 X-Gm-Features: AS18NWB42VLRC3YM2Zi_UsGMhRqBg4AWLvnbsHFRwsvIJ6vK-Rw19AEq-aRFZa4 Message-ID: Subject: Re: INSERT Permission Denied To: Tom Lane Cc: Pgsql-admin , Dugan Kniesteadt , Henry Ashu , Avi Vallarapu Content-Type: multipart/alternative; boundary="0000000000005a361d063fa4c49f" X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-25_01,2025-09-25_01,2025-03-28_01 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005a361d063fa4c49f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Granting USAGE to the table owner did the trick! Thank you, Tom! Sam On Thu, Sep 25, 2025 at 10:32=E2=80=AFAM Tom Lane wrote= : > Sam Stearns writes: > csbstage=3D*# INSERT INTO > treg. cd_combined_office_mappings ( > csbstage(*# tcsi_office_id, > combined_office_id, sb2_account_id, > postal_code, category, > .. . > > ERROR: permission > ZjQcmQRYFpfptBannerStart > This Message Is From an External Sender > This message came from outside your organization. > > ZjQcmQRYFpfptBannerEnd > > Sam Stearns writes: > > csbstage=3D*# 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.=3D) $1 FOR KEY SHARE OF x > > csbstage=3D!# 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 > > --=20 Samuel Stearns Team Lead - Database c: 971 762 6879 | o: 971 762 6879 | DAT.com --0000000000005a361d063fa4c49f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Granting USAGE to the table owner did the trick!=C2=A0 Tha= nk you, Tom!

Sam


On Thu, Sep 25, 2025 at 10:32=E2=80=AFAM Tom Lane <tgl@sss.pgh.pa.us> wrote:
=
Sam Stearns <sam.=E2=80=8Astearns@=E2=80=8Adat.=E2=80=8Acom> writes: = > csbstage=3D*# INSERT INTO treg.=E2=80=8Acd_combined_office_mappings ( = > csbstage(*# tcsi_office_id, combined_office_id, sb2_account_id, > p= ostal_code, category, > ..=E2=80=8A. > ERROR: permission
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
=C2=A0
ZjQcmQRYFpfptBannerEnd
Sam Stearns <sam.stearns@dat.com> writes:
> csbstage=3D*# 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&=
quot; x WHERE "com...
>                            ^
> QUERY:  SELECT 1 FROM ONLY "treg"."cd_combined_offices&=
quot; x WHERE
> "combined_office_id" OPERATOR(pg_catalog.=3D) $1 FOR KEY SHA=
RE OF x
> csbstage=3D!# 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


--

Samuel Stearns
Team Lead - Databas= e
c: 971 76= 2 6879 = | o: 97= 1 762 6879 | D= AT.com


--0000000000005a361d063fa4c49f--