pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: achill@matrix.gatewaynet.com
To: Abdul Wahab Dahalan <wahab@mimos.my>
Cc: pgsql-sql@postgresql.org
Subject: Re: List table with same column name
Date: Thu, 23 Oct 2003 11:31:06 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0310231130520.29589-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <3F97873C.4050409@mimos.my>

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
> 

-- 
-Achilleus




view thread (6+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0310231130520.29589-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0310231130520.29589-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0310231130520.29589-100000@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, wahab@mimos.my
  Subject: Re: List table with same column name
  In-Reply-To: <Pine.LNX.4.44.0310231130520.29589-100000@matrix.gatewaynet.com>
  References: <3F97873C.4050409@mimos.my> <Pine.LNX.4.44.0310231130520.29589-100000@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox