Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOjeS-0005Wa-AW for pgsql-general@arkaria.postgresql.org; Tue, 23 Mar 2021 16:13:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lOjeP-0002gx-Jk for pgsql-general@arkaria.postgresql.org; Tue, 23 Mar 2021 16:13:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOjeO-0002gp-Hh for pgsql-general@lists.postgresql.org; Tue, 23 Mar 2021 16:13:01 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOjeH-0004Bo-Jl for pgsql-general@lists.postgresql.org; Tue, 23 Mar 2021 16:12:59 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 619835C00C5; Tue, 23 Mar 2021 12:12:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 23 Mar 2021 12:12:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=O 5N8NFdsE46ny4gw8t4RGtYuPHqiIlNdNkF6YKjWCPw=; b=shg6/6ce61ivUlD76 l3WY7OOHI+PpeVhL2gcnkuOgzLpQZf9o1p2hTrRYSLwoXO6hk5fO8HyI7/e9lBcS RSwXEax7416QS5CtmygeacYXRudkDldKLwqGSVRI4hOU+F974lj8YApSYEkGydAn IFiIuFrQ3vlzdgntsRVMF+3MPyXPHzNOKV7Cme0UNqQLubl6mNz9ukjNJu+NGHSw 4Xglqubk4fMKHaoqTfCvZ/0/StLJq2Y6bO95MMV7pBb3reQOHeubWjBCRMzpC2s0 7HEqB25djxu9/UZa6thTKrsMfPbkm0Gzq52obFtXh5QwP0oljK2778X2Xn1i4s7d PprEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=O5N8NFdsE46ny4gw8t4RGtYuPHqiIlNdNkF6YKjWC Pw=; b=DcfTqz3FuoBswwrjdGX+vH+YheNCV3/IojryCT9fe1H+xYH2R+IiQvXX4 tfzO8wDRX+W/+CLR++dPSM0Mjk9sOyYXjqdIjprxr0xntRZuDeWDc452hikDJesR Q/KzO/h8OZvUn+t0+aMWAcjIgBd950ibnwNQ3dfU8IEo3ObLWWrIPJwOynnea8xV NRdExtly7mlgq+BjAD8CCsQgWv/neJZXGasICww/qZ3Miru3PTyLRoDZz+1gjbfb 32al4HQ16iywfgSdkoOuzOt1mZBxrFP1YqaaIt6sRArsehJ+5NLx4arPzp438lgv BxBT6UO+qpi/dtRHj8a2NQHVyc4mw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegiedgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepveevfeevfe eugeffkeekhfegieeufffgteeujedvgffhueejjefhkeejleegtdegnecukfhppeehtddr udeljedrkedtrddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from ranger.suse (50-197-80-2-static.hfc.comcastbusiness.net [50.197.80.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 7AFEB24042F; Tue, 23 Mar 2021 12:12:51 -0400 (EDT) Subject: Re: No enough privileges for autovacuum worker To: =?UTF-8?B?0JDQvdC00YDQtdC5INCh0YvRh9GR0LI=?= Cc: pgsql-general@lists.postgresql.org References: <1224144510.20210323142019@cifrasoft.com> <18310311052.20210323200728@cifrasoft.com> From: Adrian Klaver Message-ID: Date: Tue, 23 Mar 2021 09:12:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <18310311052.20210323200728@cifrasoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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