From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Leland Weathers <leland@lcweathers.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Permission denied on schema for all users on insert to table with fk
Date: Thu, 26 Jul 2018 06:31:21 -0700
Message-ID: <e28ab19a-27eb-e98a-d696-6c31c8ac7610@aklaver.com> (raw)
In-Reply-To: <CAHeq4Yw-ZLs+W1y38ejFeRCLQsa+mjjxVQLdmEovr9cmi8+pUg@mail.gmail.com>
References: <CA+QX6VWofLQLC9FP3mCeyczy7_w8m8mGGxKejiRcrBEqdNosyg@mail.gmail.com>
<0357d12a-2b1e-14ac-b9b5-7b0062c529fc@aklaver.com>
<CAHeq4Yw-ZLs+W1y38ejFeRCLQsa+mjjxVQLdmEovr9cmi8+pUg@mail.gmail.com>
On 07/26/2018 03:52 AM, Leland Weathers wrote:
>
>
>
> And a more complete example of what we are seeing with multiple
> accounts. This particular set is from an account that has their role
> set to that of the database & schema owner which is different than
> the table owner role.
>
> __
>
> __ __
>
> system=# insert into results.batch (hostname, assemblyversion)
> VALUES ('mycomp','0.0.0000.00000');____
>
> INSERT 0 1____
>
> system=# select lastval();____
>
> lastval____
>
> ---------____
>
> 6____
>
> (1 row)____
>
> __ __
>
> __ __
>
> system=# INSERT INTO results.historyitem
> (batchid,datasourceid,sequence_order)____
>
> system-# VALUES____
>
> system-# (6,20,1);____
>
> ERROR: permission denied for schema results____
>
> LINE 1: SELECT 1 FROM ONLY "results"."batch"...____
>
> ^____
>
> QUERY: SELECT 1 FROM ONLY "results"."batch" x WHERE "id"
> OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x____
>
> system=# SELECT FROM results.batch WHERE id=6;
>
> --
>
> (1 row)
What does \dn+ results show?
Before you mentioned a trigger. I am not seeing that in the schema you
sent. Is there one and if so what is it's definition and that of its
associated function?
What does show?:
select session_user, current_user;
INSERT INTO results.historyitem (batchid,datasourceid,sequence_order)
VALUES (6,20,1);
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, leland@lcweathers.net
Subject: Re: Permission denied on schema for all users on insert to table with fk
In-Reply-To: <e28ab19a-27eb-e98a-d696-6c31c8ac7610@aklaver.com>
References: <CA+QX6VWofLQLC9FP3mCeyczy7_w8m8mGGxKejiRcrBEqdNosyg@mail.gmail.com> <0357d12a-2b1e-14ac-b9b5-7b0062c529fc@aklaver.com> <CAHeq4Yw-ZLs+W1y38ejFeRCLQsa+mjjxVQLdmEovr9cmi8+pUg@mail.gmail.com> <e28ab19a-27eb-e98a-d696-6c31c8ac7610@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox