Обсуждение: table column names - search

Поиск
Список
Период
Сортировка

table column names - search

От
"Marcin Krawczyk"
Дата:
Hi all. I would like to know if there's a way to obtain a list of tables containing specified column name? Using
standardLIKE '%string' syntax would be great.<br /><br /><br />Regards,<br />mk<br /> 

Re: table column names - search

От
Peter Eisentraut
Дата:
Am Montag, 14. Januar 2008 schrieb Marcin Krawczyk:
> Hi all. I would like to know if there's a way to obtain a list of tables
> containing specified column name? Using standard LIKE '%string' syntax
> would be great.

SELECT table_schema, table_name FROM information_schema.columns WHERE 
column_name LIKE '%name%';

Add DISTINCT and other columns to taste.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: table column names - search

От
"Marcin Krawczyk"
Дата:
Thanks a lot.

2008/1/14, Peter Eisentraut <peter_e@gmx.net>:
Am Montag, 14. Januar 2008 schrieb Marcin Krawczyk:
> Hi all. I would like to know if there's a way to obtain a list of tables
> containing specified column name? Using standard LIKE '%string' syntax
> would be great.

SELECT table_schema, table_name FROM information_schema.columns WHERE
column_name LIKE '%name%';

Add DISTINCT and other columns to taste.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/