How to check dependency of table in postgresql?



How to check dependency of table in postgresql?..

Answer / Nitesh Ranjan

To check the dependency of a table in PostgreSQL, you can use the pg_depend catalog view. Here's an example query: n`SELECT n.nspname AS schema, c.relname AS table_name, d.def FROM pg_class c JOIN pg_attribute a ON c.oid = a.attrelid JOIN pg_namespace n ON c.relnamespace = n.oid JOIN pg_depend d ON a.attnum = ANY(d.objid) WHERE c.relkind = 'r' AND d.classid = c.oid AND n.nspname NOT IN ('pg_catalog', 'information_schema');`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Postgre Interview Questions

How do I set up pgadmin?

1 Answers  


What is the option that can be used in PostgreSQL to make transactions see rows affected in previous parts of the transaction?

1 Answers  


What is the port number for postgresql?

1 Answers  


How to display error message in postgresql?

1 Answers  


How to get the ddl of a table in postgresql?

1 Answers  


How many rows can postgresql handle?

1 Answers  


How do I start postgresql on linux?

1 Answers  


Does google use postgresql?

1 Answers  


Where is pg_hba conf?

1 Answers  


Explain the history of postgresql.

1 Answers  


Provide an explanation about write ahead logging?

1 Answers  


How many rows can postgres handle?

1 Answers  


Categories