Skip site navigation (1) Skip section navigation (2)

Re: table column names - search

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Cc: "Marcin Krawczyk" <jankes(dot)mk(at)gmail(dot)com>
Subject: Re: table column names - search
Date: 2008-01-14 17:24:11
Message-ID: 200801141824.12322.peter_e@gmx.net (view raw or flat)
Thread:
Lists: pgsql-sql
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/

In response to

Responses

pgsql-sql by date

Next:From: Marcin KrawczykDate: 2008-01-14 18:30:49
Subject: Re: table column names - search
Previous:From: Marcin KrawczykDate: 2008-01-14 16:38:10
Subject: table column names - search

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group