pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How can I select all of the tables with field name 'area'?
4+ messages / 3 participants
[nested] [flat]

* How can I select all of the tables with field name 'area'?
@ 2000-09-11 23:37 G. Anthony Reina <reina@nsi.edu>
  2000-09-11 23:56 ` RE: How can I select all of the tables with field name 'area'? Stuart Foster <stuartafoster@home.com>
  0 siblings, 1 reply; 4+ messages in thread

From: G. Anthony Reina @ 2000-09-11 23:37 UTC (permalink / raw)
  To: pgsql-sql

I have a database with several tables. I'd like to pull out a list of
names for the tables that contain the field (class) name 'area'.

Can this be done?

-Tony





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: How can I select all of the tables with field name 'area'?
  2000-09-11 23:37 How can I select all of the tables with field name 'area'? G. Anthony Reina <reina@nsi.edu>
@ 2000-09-11 23:56 ` Stuart Foster <stuartafoster@home.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Stuart Foster @ 2000-09-11 23:56 UTC (permalink / raw)
  To: G. Anthony Reina <reina@nsi.edu>; pgsql-sql

You should be able to query the system table that holds that column names.
Not sure which it is tho.

-----Original Message-----
From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf
Of G. Anthony Reina
Sent: Monday, September 11, 2000 4:38 PM
To: pgsql-sql@postgreSQL.org
Subject: [SQL] How can I select all of the tables with field name
'area'?


I have a database with several tables. I'd like to pull out a list of
names for the tables that contain the field (class) name 'area'.

Can this be done?

-Tony






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How can I select all of the tables with field name 'area'?
@ 2000-09-12 01:15 Darrin Ladd <dladd@newfoundcomm.net>
  2000-09-12 00:34 ` Re: How can I select all of the tables with field name 'area'? G. Anthony Reina <reina@nsi.edu>
  0 siblings, 1 reply; 4+ messages in thread

From: Darrin Ladd @ 2000-09-12 01:15 UTC (permalink / raw)
  To: Stuart Foster <stuartafoster@home.com>; G. Anthony Reina <reina@nsi.edu>; pgsql-sql

Here's what you are looking for:

SELECT pg_class.relname
FROM pg_class, pg_attribute
WHERE pg_attribute.attname = 'area'
AND pg_attribute.attrelid = pg_class.oid;

This should give you all of the classes (tables) which have the attribute
(field) 'area'.

Cheers,
Darrin

-----Original Message-----
From: Stuart Foster <stuartafoster@home.com>
To: G. Anthony Reina <reina@nsi.edu>; pgsql-sql@postgreSQL.org
<pgsql-sql@postgreSQL.org>
Date: Monday, September 11, 2000 7:03 PM
Subject: RE: [SQL] How can I select all of the tables with field name
'area'?


>You should be able to query the system table that holds that column names.
>Not sure which it is tho.
>
>-----Original Message-----
>From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf
>Of G. Anthony Reina
>Sent: Monday, September 11, 2000 4:38 PM
>To: pgsql-sql@postgreSQL.org
>Subject: [SQL] How can I select all of the tables with field name
>'area'?
>
>
>I have a database with several tables. I'd like to pull out a list of
>names for the tables that contain the field (class) name 'area'.
>
>Can this be done?
>
>-Tony
>
>
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How can I select all of the tables with field name 'area'?
  2000-09-12 01:15 Re: How can I select all of the tables with field name 'area'? Darrin Ladd <dladd@newfoundcomm.net>
@ 2000-09-12 00:34 ` G. Anthony Reina <reina@nsi.edu>
  0 siblings, 0 replies; 4+ messages in thread

From: G. Anthony Reina @ 2000-09-12 00:34 UTC (permalink / raw)
  To: Darrin Ladd <dladd@newfoundcomm.net>; +Cc: Stuart Foster <stuartafoster@home.com>; pgsql-sql

Thanks Darrin and Stuart.

-Tony




Darrin Ladd wrote:

> Here's what you are looking for:
>
> SELECT pg_class.relname
> FROM pg_class, pg_attribute
> WHERE pg_attribute.attname = 'area'
> AND pg_attribute.attrelid = pg_class.oid;
>
> This should give you all of the classes (tables) which have the attribute
> (field) 'area'.
>
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-09-12 01:15 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-11 23:37 How can I select all of the tables with field name 'area'? G. Anthony Reina <reina@nsi.edu>
2000-09-11 23:56 ` Stuart Foster <stuartafoster@home.com>
2000-09-12 01:15 Re: How can I select all of the tables with field name 'area'? Darrin Ladd <dladd@newfoundcomm.net>
2000-09-12 00:34 ` G. Anthony Reina <reina@nsi.edu>

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