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

264
Visualizações
Postgres how to transfer all enums from foreign server

I have two databases that I want to be able to transfer data between, so I want to import a large schema from one database to the other, where there is allot of enums. So I ran into the problem descripted here SQL: error when creating a foreign table that has an enum column.

So I though I would like to something like "pg_dump enum" to get the enums and transfer them to the other database. But I can't such a command. Can you help me ?

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

0

You can export the definitions with a query like this:

SELECT format(
          'CREATE TYPE %s AS ENUM (%s);',
          enumtypid::regtype,
          string_agg(quote_literal(enumlabel), ', ')
       )
FROM pg_enum
GROUP BY enumtypid;
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