I want to find where all the stored procedure
or function
is getting used in database like in other procedures, functions, views etc.
In MSSQL we used:
DECLARE
@sp nvarchar(100)
SET @sp = N'proc_name'
SELECT dm.*,o.type_desc
FROM sys.dm_sql_referencing_entities(@sp, 'OBJECT') dm
left join sys.objects o on dm.referencing_entity_name= o.name;
Looking for similar fashion query in the PostgreSQL.
By searching found pg_depend but didn't understand how to get similar output as shown above in MSSQL query.