Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

417
Visualizações
No se puede crear el índice de floración

Soy nuevo en los índices de floración. Me refiero al enlace https://habr.com/en/company/postgrespro/blog/452968/ para conocer los nuevos índices.

Cuando intentaba crear un índice de floración en la propia tabla de prueba, recibí el siguiente error:

 SQL Error [42704]: ERROR: data type bigint has no default operator class for access method "bloom" Hint: You must specify an operator class for the index or define a default operator class for the data type.

Sin duda, porque en mi tabla tengo una columna en la que uso el tipo de datos bigint y la misma columna que incluyo en la creación de mi índice.

Para evitar ese error, traté de crear mi propia clase para el tipo de datos bigint. Como abajo:

 CREATE OPERATOR CLASS bigint_ops DEFAULT FOR TYPE int USING bloom AS OPERATOR 1 =(bigint,bigint), FUNCTION 1 hashbigint;

y obtuve el siguiente error:

 SQL Error [42883]: ERROR: could not find a function named "hashbigint"

Cualquier ayuda para evitar este error será muy apreciada.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

La función hash para bigint es hashint8 , no hashbigint . Encontré esto ejecutando la consulta en la publicación que vinculó y filtrando hasta donde el tipo es 'bigint'.

 testdb=# with t0 as (select distinct opc.opcintype::regtype::text, amop.amopopr::regoperator, ampr.amproc from pg_am am, pg_opclass opc, pg_amop amop, pg_amproc ampr where am.amname = 'hash' and opc.opcmethod = am.oid and amop.amopfamily = opc.opcfamily and amop.amoplefttype = opc.opcintype and amop.amoprighttype = opc.opcintype and ampr.amprocfamily = opc.opcfamily and ampr.amproclefttype = opc.opcintype order by opc.opcintype::regtype::text) select * from t0 where opcintype='bigint'; opcintype | amopopr | amproc -----------+------------------+---------- bigint | =(bigint,bigint) | hashint8 (1 row)

También hay un error en su instrucción CREATE OPERATOR; debe ser DEFAULT FOR TYPE bigint , no int .

 testdb=# create extension bloom; CREATE EXTENSION testdb=# CREATE OPERATOR CLASS bigint_ops DEFAULT FOR TYPE int USING bloom AS OPERATOR 1 =(bigint,bigint), FUNCTION 1 hashint8; ERROR: could not make operator class "bigint_ops" be default for type pg_catalog.int4 DETAIL: Operator class "int4_ops" already is the default. testdb=# CREATE OPERATOR CLASS bigint_ops DEFAULT FOR TYPE bigint USING bloom AS OPERATOR 1 =(bigint,bigint), FUNCTION 1 hashint8; CREATE OPERATOR CLASS testdb=#
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda