Re: How to query for a user-table column name?

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Kevin Kempter <kevin(at)kevinkempterllc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to query for a user-table column name?
Date: 2008-01-10 17:47:55
Message-ID: 20080110094755.4721ae1f@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 10 Jan 2008 10:38:16 -0700
Kevin Kempter <kevin(at)kevinkempterllc(dot)com> wrote:

> Hi List;
>
> I'm researching a db and I want to find samples of some of the data.
> I know based on the documentation for the proposed "new" schema that
> the db I have access to (the "old" schema) probably has a column in
> one or more of the user tables called 'region'.
>
> I'm looking for a way to query the system tables to find all user
> tables with a column named region. Any thoughts, help?

select * from information_schema.columns?

table_catalog | information_schema.sql_identifier |
table_schema | information_schema.sql_identifier |
table_name | information_schema.sql_identifier |
column_name | information_schema.sql_identifier

Sincerely,

Joshua D. Drake

>
>
> Thanks in advance..
>
> /Kevin
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 9: In versions below 8.0,
> the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>

- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHhlpNATb/zqfZUUQRAow1AJ9K0ZYm75gJg3/Ti+/xpghkMdm4RwCeK4vU
QXO9VvUK6Dw9NUEgarMTDCM=
=Cgh+
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2008-01-10 17:48:53 Re: Storing and querying boolean fields
Previous Message Tom Lane 2008-01-10 17:42:31 Re: [GENERAL] 8.3 Beta Incompatible Data Disaster