X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 33036D1B52D for ; Thu, 23 Oct 2003 08:17:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 01000-06 for ; Thu, 23 Oct 2003 05:17:20 -0300 (ADT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 5C1E1D1B548 for ; Thu, 23 Oct 2003 05:17:17 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id h9N8V6dN029685; Thu, 23 Oct 2003 11:31:06 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id h9N8V6VY029681; Thu, 23 Oct 2003 11:31:06 +0300 Date: Thu, 23 Oct 2003 11:31:06 +0300 (EEST) From: achill@matrix.gatewaynet.com To: Abdul Wahab Dahalan Cc: pgsql-sql@postgresql.org Subject: Re: List table with same column name In-Reply-To: <3F97873C.4050409@mimos.my> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/298 X-Sequence-Number: 15698 On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: > Hi! > How do I list all the tables in the database which has a same column name?. SELECT t1.relname,a1.attname,t2.relname from pg_class t1,pg_attribute a1,pg_class t2,pg_attribute a2 where a1.attrelid=t1.oid and t1.relkind='r' and a1.attnum>0 and a2.attrelid=t2.oid and t2.relkind='r' and a2.attnum>0 and t1.relname > Thanks > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- -Achilleus