Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0DF352E31B2 for ; Mon, 14 Jan 2008 14:30:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 14457-03 for ; Mon, 14 Jan 2008 14:30:49 -0400 (AST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by postgresql.org (Postfix) with ESMTP id EDBA02E30AF for ; Mon, 14 Jan 2008 14:30:50 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c36so492967ana.33 for ; Mon, 14 Jan 2008 10:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=bGD55MUppfuZLF4npklQ/P4yqR79mZ+WV0lGzQ+4bxk=; b=SC65I2Ol4cxQAibhdA1i/7YrdkGjzUdWx0JyG+4sMoGY0Fi5lpl2j+lTPzQy5fU022y96ZgaMxBfUIlr8DTW+yBjbh16oy4fecvB5kJaYnZgRVFCW8jSEpVput0U5JcU0D4Hc4gojJZFKWxemvv7Xu7KfR/CDV37hh7CeRYnpas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=qkeoxmBn2wLHM6/eDTcivI6ZbCCqO/9RDsqyheqS/R5LYxJx9nGyC0QtSHItMdoJYA9B/bwaZDeShFwYGz6zN0X8mM2K38bUgd3r0kKwiSPufeardsBSq8TDHq7+VVznTtRm/pntCjijOLK6S/JcINKNH7JjJlgzP3Afk1Ry6bY= Received: by 10.100.251.5 with SMTP id y5mr14775092anh.12.1200335450000; Mon, 14 Jan 2008 10:30:50 -0800 (PST) Received: by 10.100.137.1 with HTTP; Mon, 14 Jan 2008 10:30:49 -0800 (PST) Message-ID: <95f6bf9b0801141030h1ffcdad3q1d8e79f0aba4335@mail.gmail.com> Date: Mon, 14 Jan 2008 19:30:49 +0100 From: "Marcin Krawczyk" To: "Peter Eisentraut" Subject: Re: table column names - search Cc: pgsql-sql@postgresql.org In-Reply-To: <200801141824.12322.peter_e@gmx.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8440_8070890.1200335449987" References: <95f6bf9b0801140838v2c14f3aav310a7011eabdb1f5@mail.gmail.com> <200801141824.12322.peter_e@gmx.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/112 X-Sequence-Number: 29965 ------=_Part_8440_8070890.1200335449987 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks a lot. 2008/1/14, 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/ > ------=_Part_8440_8070890.1200335449987 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/

------=_Part_8440_8070890.1200335449987--