Re: vacuumdb -Z can't find function declared on functional index with inline sql function

Поиск
Список
Период
Сортировка
От Jaime Soler
Тема Re: vacuumdb -Z can't find function declared on functional index with inline sql function
Дата
Msg-id CAKVUGgRD5dSZD+8=f_fvtu1PeY-tq9MriVv3-C6gHCMGaYqJpg@mail.gmail.com
обсуждение исходный текст
Ответ на vacuumdb -Z can't find function declared on functional index with inline sql function  (Jaime Soler <jaime.soler@gmail.com>)
Список pgsql-bugs
I forgot to mention that vacuum verbose analyze on this table was correct. 
vacuum (verbose, analyze) test
postgres-# ;
INFO:  haciendo vacuum a «public.test»
INFO:  el índice «funct_index» ahora contiene 0 versiones de filas en 1 páginas
DETAIL:  0 versiones de filas del índice fueron eliminadas.
0 páginas de índice han sido eliminadas, 0 son reusables.
CPU: usuario: 0.00 s, sistema: 0.00 s, transcurrido: 0.00 s.
INFO:  «test»: se encontraron 0 versiones de filas eliminables y 0 no eliminables en 0 de 0 páginas
DETAIL:  0 versiones muertas de filas no pueden ser eliminadas aún, xmin máx antiguo: 529
Hubo 0 identificadores de ítem sin usar.
Omitiendo 0 páginas debido a «pins» de página, 0 páginas marcadas «frozen».
0 páginas están completamente vacías.
CPU: usuario: 0.00 s, sistema: 0.00 s, transcurrido: 0.00 s.
INFO:  haciendo vacuum a «pg_toast.pg_toast_16386»
INFO:  el índice «pg_toast_16386_index» ahora contiene 0 versiones de filas en 1 páginas
DETAIL:  0 versiones de filas del índice fueron eliminadas.
0 páginas de índice han sido eliminadas, 0 son reusables.
CPU: usuario: 0.00 s, sistema: 0.00 s, transcurrido: 0.00 s.
INFO:  «pg_toast_16386»: se encontraron 0 versiones de filas eliminables y 0 no eliminables en 0 de 0 páginas
DETAIL:  0 versiones muertas de filas no pueden ser eliminadas aún, xmin máx antiguo: 529
Hubo 0 identificadores de ítem sin usar.
Omitiendo 0 páginas debido a «pins» de página, 0 páginas marcadas «frozen».
0 páginas están completamente vacías.
CPU: usuario: 0.00 s, sistema: 0.00 s, transcurrido: 0.00 s.
INFO:  analizando «public.test»
INFO:  «test»: se procesaron 0 de 0 páginas, que contenían 0 filas vigentes y 0 filas no vigentes; 0 filas en la muestra, 0 total de filas estimadas
VACUUM

Thanks

El jue, 19 nov 2020 a las 18:43, Jaime Soler (<jaime.soler@gmail.com>) escribió:
Hi,

Vacuumdb rise an error when refreshing statistics of a table that has a functional index.
Here is the error:

vacuumdb -Z -d postgres -p 5433
vacuumdb: limpiando la base de datos «postgres»
vacuumdb: error: falló la limpieza de la tabla «public.test» en la base de datos «postgres»: ERROR:  no existe la función sinacentos(text)
LINE 2:     select tipotec || '_' || upper(sinacentos(trim(nombre)))...
                                           ^
HINT:  Ninguna función coincide en el nombre y tipos de argumentos. Puede ser necesario agregar conversión explícita de tipos.
QUERY:  
    select tipotec || '_' || upper(sinacentos(trim(nombre)));
   
CONTEXT:  función SQL «tecnologia_index_func», durante expansión en línea

This is the definition of the functions, index and table:
 CREATE OR REPLACE FUNCTION public.sinacentos(text character varying)
     RETURNS character
     LANGUAGE sql
     IMMUTABLE
    AS $function$
    select translate($1,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU');
    $function$

CREATE OR REPLACE FUNCTION public.tecnologia_index_func(nombre character varying, tipotec bigint)
     RETURNS text
     LANGUAGE sql
     IMMUTABLE
    AS $function$
    select tipotec || '_' || upper(sinacentos(trim(nombre)));
    $function$

create index funct_index on test ( tecnologia_index_func(test.nombre));

create table test ( id serial, nombre text) ;

select version();
                                                             version                                                              
----------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 13.1 (Ubuntu 13.1-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

database instance was initialized with default settings values.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Jaime Soler
Дата:
Сообщение: vacuumdb -Z can't find function declared on functional index with inline sql function
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: vacuumdb -Z can't find function declared on functional index with inline sql function