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

101
Visualizações
Create an index with both indexed and `INCLUDE` columns in PostgreSQL using ActiveRecord

What I want to create is one of the indexes that has some columns indexed and others included. This kind of index is described by PostgreSQL in their documentation here

The SQL query to create the index looks something like CREATE INDEX tab_x_y ON tab(x) INCLUDE (y);

Looking at the ActiveRecord PostgreSQL adapter documentation here

I don't see any option for me to use this INCLUDE column feature.

Do I have to run this as a raw SQL query? Is there another way?

Notes

  1. I am not asking how to run a query or which index will be used for a query.
  2. I am not asking how to create a regular index using ActiveRecord.
  3. I am not asking how to create a migration using ActiveRecord.
  4. I specifically want information about how to create a specific kind of index with a specific option.
over 4 years ago · Santiago Trujillo
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