Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda