I added a foreign key on my table which references pg_class.
ALTER TABLE summary_table
ADD FOREIGN KEY (table_oid_column) REFERENCES pg_class (oid) ON DELETE CASCADE;
I have a summary table which I keep some information about tables with their relational ids. When I drop a table I want to delete automatically related row from my summary table, so I added constraint above. But in my case, when I drop a table nothing happens.
I tried it with a test table, when I delete related row from test table, it works as expected. Such as with this foreign key constraint:
ALTER TABLE summary_table
ADD FOREIGN KEY (table_oid_column) REFERENCES test (id) ON DELETE CASCADE;
What can be the problem? Can it be related with being a catalog table(pg_class) or a hidden system column(oid)?