Easy way:
SELECT table_name FROM information_schema.columns WHERE column_name = ''
or
SELECT table_name FROM pg_sysviews.pg_user_table_columns WHERE
column_name = ''
If those don't work, select from pg_attribute a join pg_class c on
(c.oid = a.reloid)
On Fri, Sep 30, 2005 at 10:55:44AM -0400, Emi
On 9/30/05, Emi Lu <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I am not very familiar with the system views/tables in postgreSQL. I'd
> like to get all table names that have a column let's say named "col1".
I'd use:
select table_name
from information_schema.columns
where table_schema='my_schem
pgsql stores table names in pg_class.relname, column names in
pg_attribute.attname.
Read the document and you can get the solution.
"Emi Lu" <[EMAIL PROTECTED]> wrote
> Greetings,
>
> I am not very familiar with the system views/tables in postgreSQL. I'd
> like to get all table names that have a
Emi Lu wrote:
> Greetings,
>
> I am not very familiar with the system views/tables in postgreSQL. I'd
> like to get all table names that have a column let's say named "col1".
>
> For example,
> t1 (... col1 varchar(3) ... )
> t2 (... col1 varchar(3) ... )
> t3 (... ...)
>
>
> After querying the
am 30.09.2005, um 10:55:44 -0400 mailte Emi Lu folgendes:
> Greetings,
>
> I am not very familiar with the system views/tables in postgreSQL. I'd like
> to get all table names that have a column let's say named "col1".
select table_name from information_schema.columns where column_name = 'col1'
Greetings,
I am not very familiar with the system views/tables in postgreSQL. I'd
like to get all table names that have a column let's say named "col1".
For example,
t1 (... col1 varchar(3) ... )
t2 (... col1 varchar(3) ... )
t3 (... ...)
After querying the system tables/views, I can get the