Sample Header Ad - 728x90

How do you find specific column name in function/sequences

0 votes
1 answer
1456 views
I am trying to see if a specific column exists in any functions/sequences. I have found a script which can search tables, is there anything out there that would allow me to search in functions/sequences (generally anywhere ideally)?
select t.table_schema,
       t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name 
                                and c.table_schema = t.table_schema
where c.column_name = 'product_id'
      and t.table_schema not in ('information_schema', 'pg_catalog')
order by t.table_schema;
The above can show me views/tables that have a product_id column. Currently working with Postgres 12. Can't seem to find one that would list for functions/sequences.
Asked by rdbmsNoob (459 rep)
Aug 5, 2022, 12:45 PM
Last activity: Jul 18, 2024, 04:06 PM