Re: INSERT Permission Denied

From: Sam Stearns <sam(dot)stearns(at)dat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>, Dugan Kniesteadt <dugan(dot)kniesteadt(at)dat(dot)com>, Henry Ashu <henry(dot)ashu(at)dat(dot)com>, Avi Vallarapu <av(at)hexacluster(dot)ai>
Subject: Re: INSERT Permission Denied
Date: 2025-09-25 18:59:10
Message-ID: CAN6TVjkGzh0MnK6S=hXvtGRvSgF8PWv_=uFkgij_G3kyjzj18Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Granting USAGE to the table owner did the trick! Thank you, Tom!

Sam

On Thu, Sep 25, 2025 at 10:32 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Sam Stearns <sam. stearns@ dat. com> writes: > csbstage=*# 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 <sam(dot)stearns(at)dat(dot)com> 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
>
>

--

Samuel Stearns
Team Lead - Database
c: 971 762 6879 | o: 971 762 6879 | DAT.com

<https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ishan joshi 2025-09-30 05:59:39 canceling/terminating statement due to conflict with recovery in Replica/DR instances
Previous Message Tom Lane 2025-09-25 17:32:55 Re: INSERT Permission Denied