There is a table in redshift, which is causing a problem to complete a run as it has huge data set. So I need to replace the table with another table. This table is present in few stored procedure code. But here is a challenge. There are around 300+ stored procedure in the database. So, anyone please help me to write with a query, like what are list of procedures that using the particular table.
You could query the catalog pg_proc
like this to find out if <particular table>
is used in a stored procedure:
SELECT n.nspname as schema_name,
u.usename as sp_owner,
p.proname as stored_procedure_name,
p.prosrc as procedure_source
FROM pg_catalog.pg_namespace n
JOIN pg_catalog.pg_proc p ON pronamespace = n.oid
JOIN pg_catalog.pg_user u on u.usesysid = p.proowner
where prosrc like '%<particular table>%';
Or you could use PG_PROC_INFO , a Redshift system view built on the PostgreSQL catalog table PG_PROC
and the internal catalog table PG_PROC_EXTENDED
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.