MultiXactId wraparound and last aggressive vacuum time

2021-03-23 Thread Michael Schanne
Hi, My application is getting the following exception: InternalError: (psycopg2.InternalError) MultiXactId 808263738 has not been created yet -- apparent wraparound I read over https://www.postgresql.org/docs/9.6/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND and I suspect the issue was

No enough privileges for autovacuum worker

2021-03-23 Thread Андрей Сычёв
Hi everyone, Every minute, I see the following error message in my server logs: 2021-03-23 13:00:07.564 MSK [60828]-[]-[]-[autovacuum worker]-[42501]-[@] ERROR: permission denied for schema dict at character 34 2021-03-23 13:00:07.564 MSK [60828]-[]-[]-[autovacuum worker]-[42501]-[@] QUERY:

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Adrian Klaver
On 3/23/21 3:20 AM, Андрей Сычёв wrote: Hi everyone, Every minute, I see the following error message in my server logs: 2021-03-23 13:00:07.564 MSK [60828]-[]-[]-[autovacuum worker]-[42501]-[@] ERROR: permission denied for schema dict at character 34 2021-03-23 13:00:07.564 MSK [60828]-[]-[]-

Re: MultiXactId wraparound and last aggressive vacuum time

2021-03-23 Thread Michael Lewis
I don't believe you can determine a date/time that it happened, but querying the age of the table is simple to do and then you can compare that with the freeze age parameters. A periodic manual vacuum freeze may preclude the system ever needing to perform the emergency autovacuum freeze, and as an

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Adrian Klaver
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 NUL

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Adrian Klaver
On 3/23/21 9:18 AM, Андрей Сычёв wrote: Sorry, my mistake, but actually trigrams_array is called by trigrams_vector Yes and that is at least one of the issues: 2021-03-23 13:00:07.564 MSK [60828]-[]-[]-[autovacuum worker]-[42501]-[(at)] ERROR: permission denied for schema dict at character

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Андрей Сычёв
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

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Андрей Сычёв
Sorry, my mistake, but actually trigrams_array is called by trigrams_vector Definition for the function dict.trigrams_vector: CREATE OR REPLACE FUNCTION dict.trigrams_vector(word text) RETURNS tsvector LANGUAGE sql IMMUTABLE STRICT AS $function$ SELECT array_to_string(dict.trigrams_ar

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Андрей Сычёв
I do not know who is running dict.trigrams_vector. There is no explicit call for this function. It is used implicitly in the index definition for the table fpbackup.fp_vpn_data_2021w12: CREATE INDEX fp_vpn_data_2021w12_trigrams_vector_idx ON fpbackup.fp_vpn_data_2021w12 USING gin (dict.trigram

Re: No enough privileges for autovacuum worker

2021-03-23 Thread Adrian Klaver
On 3/23/21 9:45 AM, Андрей Сычёв wrote: I do not know who is running dict.trigrams_vector. There is no explicit call for this function. It is used implicitly in the index definition for the table fpbackup.fp_vpn_data_2021w12: CREATE INDEX fp_vpn_data_2021w12_trigrams_vector_idx ON fpbackup.f

need clarification on CTE/join

2021-03-23 Thread Marc Millas
Hi, if I do: postgres=# with numb as(select ceiling(2582*random()) rand, generate_series(1,5) as monnum) select rand, monnum from numb; rand | monnum --+ 1543 | 1 2299 | 2 205 | 3 523 | 4 677 | 5 (5 lines) ok, fine. The random numbers are at random...

Re: need clarification on CTE/join

2021-03-23 Thread David G. Johnston
On Tue, Mar 23, 2021 at 6:45 PM Marc Millas wrote: > So.. I would like to understand the "why" of this behaviour, ie. the > change of order when I do the cast. > I believe the "why" is immaterial here. Your queries do not contain order by so your results are unordered - even if there appears to

Re: need clarification on CTE/join

2021-03-23 Thread Marc Millas
Hi, I cannot agree. I did an explain analyze with and without the cast: its extremely different: postgres=# explain analyze with numb as(select ceiling(2582*random())::int rand, generate_series(1,5) as monnum) select monnum, prenom from numb,prenoms where numb.rand=prenoms.id;

Re: need clarification on CTE/join

2021-03-23 Thread David G. Johnston
On Tuesday, March 23, 2021, Marc Millas wrote: > Hi, > > I cannot agree. > I did an explain analyze with and without the cast: its > extremely different: > > postgres=# explain analyze with numb as(select ceiling(2582*random())::int > rand, generate_series(1,5) as monnum) select monnum, prenom fr