• Mémo Afficher les tables avec un nom de champ spécifique avec Postgresql

  • Display tables with specific field name in Postgresql

select t.table_schema,
       t.table_name,
       c.column_name,
       c.data_type
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 like '%MY FIELD NAME%'
  and t.table_schema not in ('information_schema', 'pg_catalog')
  and t.table_type = 'BASE TABLE'
order by t.table_schema, c.data_type;


13 octobre 2021 11:51