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

Re: List table with same column name

From: achill(at)matrix(dot)gatewaynet(dot)com
To: Abdul Wahab Dahalan <wahab(at)mimos(dot)my>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: List table with same column name
Date: 2003-10-23 08:31:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
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<t2.relname and a1.attname = a2.attname;

> Thanks
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


In response to


pgsql-sql by date

Next:From: Peter ChildsDate: 2003-10-23 08:40:15
Subject: Re: List table with same column name
Previous:From: Abdul Wahab DahalanDate: 2003-10-23 07:46:04
Subject: List table with same column name

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