Re: No enough privileges for autovacuum worker

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Андрей Сычёв <andrey(dot)sychev(at)cifrasoft(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: No enough privileges for autovacuum worker
Date: 2021-03-23 16:12:50
Message-ID: f7ce0f69-e3db-c8f1-5937-8eea25566ecf@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Андрей Сычёв 2021-03-23 16:18:57 Re: No enough privileges for autovacuum worker
Previous Message Андрей Сычёв 2021-03-23 16:07:28 Re: No enough privileges for autovacuum worker