How to find a column name

Started by lrnrover 21 years ago2 messagesgeneral
Jump to latest
#1lrnr
ns@nospam.com

Hi,

Is there in Postgresql something like the all_tab_columns table in
ORACLE? How can I find if a column name exists in the database?

For example, I want to find all columns that have a name containing the
string 'USER', in any table. How can I do this?

--
lrnr

#2Peter Eisentraut
peter_e@gmx.net
In reply to: lrnr (#1)
Re: How to find a column name

lrnr wrote:

For example, I want to find all columns that have a name containing
the string 'USER', in any table. How can I do this?

SELECT * FROM information_schema.columns WHERE column_name LIKE
'%USER%';

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