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

214
Visualizações
can't drop view because of dependencies

when dropping this view:

drop view employees;

i get the following error message:

ERROR:  cannot drop view employees because other objects depend on it
DETAIL:  view telephone_number_collection depends on view employees
view email_collection depends on view employees
policy employee_rights_select_only_own_person_address on table person_addresses depends on view employees
policy employee_rights_select_only_own_person_email on table person_emails depends on view employees
policy employee_rights_select_only_own_person_telnumber on table person_telephone_numbers depends on view employees
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
SQL state: 2BP01

dropping the views email_collection and telephone_number_collection works to avoid the first part of the error. But i don't understand the second part:

policy employee_rights_select_only_own_person_address on table person_addresses depends on view employees
policy employee_rights_select_only_own_person_email on table person_emails depends on view employees
policy employee_rights_select_only_own_person_telnumber on table person_telephone_numbers depends on view employees

i can't find the 3 policys in the 3 described tables. Can anyone help me understand the error message respectively finding the policies in pgAdmin to check if i can use DROP ... CASCADE or delete the policies manually without destroying important things?

edit: the actual problem was, that i tied to replace a function, where the return type changed. But thats impossible. If the return type changes you have to first drop the function und than create it again.

drop FUNCTION public.get_employees;

But it was impossible to drop the function because of a dependency on the view employees.

ERROR:  cannot drop function get_employees() because other objects depend on it
DETAIL:  view employees depends on function get_employees()
view telephone_number_collection depends on view employees
view email_collection depends on view employees
policy employee_rights_select_only_own_person_address on table person_addresses depends on view employees
policy employee_rights_select_only_own_person_email on table person_emails depends on view employees
policy employee_rights_select_only_own_person_telnumber on table person_telephone_numbers depends on view employees
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
SQL state: 2BP01

That's why i asked the first question. I only want to drop all views and policies temporary and create them again after i droped and created the function public.get_employees;

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