From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Андрей Сычёв <andrey.sychev@cifrasoft.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: No enough privileges for autovacuum worker
Date: Thu, 25 Mar 2021 07:57:27 -0700
Message-ID: <9c987b8d-6690-211a-2795-d33bd0de36ef@aklaver.com> (raw)
In-Reply-To: <1886471445.20210325122537@cifrasoft.com>
References: <1224144510.20210323142019@cifrasoft.com>
<dfa9e41a-633b-0b02-2c17-75e05da300e8@aklaver.com>
<18310311052.20210323200728@cifrasoft.com>
<f7ce0f69-e3db-c8f1-5937-8eea25566ecf@aklaver.com>
<1723387856.20210323201857@cifrasoft.com>
<56104bce-d461-1fa2-8c8d-96dd4a13ba92@aklaver.com>
<913296991.20210323204551@cifrasoft.com>
<d0f325b2-61f0-b973-98c4-338b2e604aea@aklaver.com>
<3510602133.20210324121638@cifrasoft.com>
<87e40ae6-efa8-f930-55e1-cceab4d1d63a@aklaver.com>
<1886471445.20210325122537@cifrasoft.com>
On 3/25/21 1:25 AM, Андрей Сычёв wrote:
> Because in trigger where table fpbackup.fp_vpn_data_2021w12 has
> been created there are several DDL commands:
>
> EXECUTE 'CREATE TABLE "' || fp_schema_name || '"."' || fp_table_name || '" (LIKE '|| fp_parent_table_name || ' INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING INDEXES) WITHOUT OIDS TABLESPACE ' || fp_tablespace;
>
> EXECUTE 'ALTER TABLE "' || fp_schema_name || '"."' || fp_table_name || '" OWNER TO fpbkwriter';
>
> The trigger was called by user "worker" that already had permission on
> USAGE of schema dict, so table creation was successful. But after that
> the ownership of the table was moving to "fpbkwriter" that had no permission on
> USAGE of schema dict, thus the error occured.
>
> In reality, there was no user "fpbkwriter" at the beginning. Only user
> "worker" was created. And when the user "fpbkwriter" was created, he was
> not granted by enough privileges mistakenly.
>
Alright that I understand. Still after the ALTER TABLE ... OWNER TO
fpbkwriter, the index was running as fpbkwriter yet there where no
errors? Did that mean the table was never queried or the index never used?
--
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, andrey.sychev@cifrasoft.com
Subject: Re: No enough privileges for autovacuum worker
In-Reply-To: <9c987b8d-6690-211a-2795-d33bd0de36ef@aklaver.com>
References: <1224144510.20210323142019@cifrasoft.com> <dfa9e41a-633b-0b02-2c17-75e05da300e8@aklaver.com> <18310311052.20210323200728@cifrasoft.com> <f7ce0f69-e3db-c8f1-5937-8eea25566ecf@aklaver.com> <1723387856.20210323201857@cifrasoft.com> <56104bce-d461-1fa2-8c8d-96dd4a13ba92@aklaver.com> <913296991.20210323204551@cifrasoft.com> <d0f325b2-61f0-b973-98c4-338b2e604aea@aklaver.com> <3510602133.20210324121638@cifrasoft.com> <87e40ae6-efa8-f930-55e1-cceab4d1d63a@aklaver.com> <1886471445.20210325122537@cifrasoft.com> <9c987b8d-6690-211a-2795-d33bd0de36ef@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