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: Tue, 23 Mar 2021 09:12:50 -0700
Message-ID: <f7ce0f69-e3db-c8f1-5937-8eea25566ecf@aklaver.com> (raw)
In-Reply-To: <18310311052.20210323200728@cifrasoft.com>
References: <1224144510.20210323142019@cifrasoft.com>
<dfa9e41a-633b-0b02-2c17-75e05da300e8@aklaver.com>
<18310311052.20210323200728@cifrasoft.com>
On 3/23/21 9:07 AM, Андрей Сычёв wrote:
>
> Definition for the table fpbackup.fp_vpn_data_2021w12:
>
> CREATE TABLE fpbackup.fp_vpn_data_2021w12 (
> id int8 NOT NULL DEFAULT nextval('fp_vpn_data_id_seq'::regclass),
> fp_date_start timestamp NOT NULL,
> fp_date_end timestamp NOT NULL,
> ....
> fp_host varchar NOT NULL,
> ....
> CONSTRAINT c_d_fp_vpn_data_2021w12 CHECK (((fp_date_start >= '2021-03-19 00:00:00'::timestamp without time zone) AND (fp_date_start < '2021-03-26 00:00:00'::timestamp without time zone))),
> CONSTRAINT fp_vpn_data_2021w12_pkey PRIMARY KEY (id)
> )
> INHERITS (public.fp_vpn_data)
> TABLESPACE myts4
> ;
> CREATE INDEX fp_vpn_data_2021w12_fp_host_idx ON fpbackup.fp_vpn_data_2021w12 USING btree (fp_host);
> CREATE INDEX fp_vpn_data_2021w12_trigrams_vector_idx ON fpbackup.fp_vpn_data_2021w12 USING gin (dict.trigrams_vector((fp_host)::text));
>
> ------------------------
>
> Definition for the function dict.trigrams_array:
>
> CREATE OR REPLACE FUNCTION dict.trigrams_array(word text)
> RETURNS text[]
> LANGUAGE plpgsql
> IMMUTABLE STRICT
> AS $function$
> DECLARE
> result text[];
> BEGIN
> FOR i IN 1 .. length(word) - 2 LOOP
> result := result || quote_literal(substr(lower(word), i, 3));
> END LOOP;
>
> RETURN result;
> END;
> $function$
> ;
>
> ------------------------
The function that is throwing the error is trigrams_vector(). The above
is called in trigrams_vector, though that is not happening due to
permissions error. So we need information on trigrams_vector().
>
> I do not know exactly what user the function running as is because it
> is implicit call.
>
> I know that records in table the dict.trigrams_array are inserted by user
> "worker".
>
> Owner of the table fpbackup.fp_vpn_data_2021w12 is user "fpbkwriter".
>
> user "worker" and "fpbkwriter" have the following permissions:
>
> GRANT USAGE
> ON SCHEMA
> dict
> TO worker;
>
> GRANT EXECUTE
> ON ALL FUNCTIONS IN SCHEMA
> dict
> TO worker;
>
> GRANT fpbkwriter TO worker GRANTED BY postgres;
>
> GRANT USAGE, CREATE
> ON SCHEMA
> fpbackup
> TO fpbkwriter;
>
> The user "fpbkwriter" does not have any privileges related to schema
> "dict".
>
--
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: <f7ce0f69-e3db-c8f1-5937-8eea25566ecf@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>
* 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