Обсуждение: Need help accessing TABLES, COLUMNS, DESCRIPTIONS

Поиск
Список
Период
Сортировка

Need help accessing TABLES, COLUMNS, DESCRIPTIONS

От
"Robert Paresi"
Дата:
Hello,

I can't figure this out, and need help.

I need access (VIA SQL Statements) to retreive a list of all PUBLIC tables,
columns and their descriptions.

I found:

tables
columns
pg_description

1. There is no link between the description (object ID and the
tables/columns)
2. pg_descriptions seems to be in another place than tables/columns, why?
(inaccessible)
3. I also need access to the user (table of users) and which tables they
have access to.

Meaning, an sql statement that says:

Give me all the tables, columns and descriptions of all the PUBLIC tables a
particular user has access to:

For example:

select table,table_object_id, column, column_object_Id,
isColumnPrimaryKey,Column_Description
   from tables,columns,pg_descriptions
     join (tell me)
       where they are 'public' tables and are accessible by user
'ReportUser'

I can do this in Sybase SQL Anywhere very easily.

I need to do it in PostGreSQL  9

Thank you.





Re: Need help accessing TABLES, COLUMNS, DESCRIPTIONS

От
Craig Ringer
Дата:
On 01/21/2011 10:45 PM, Robert Paresi wrote:
> Hello,
>
> I can't figure this out, and need help.
>
> I need access (VIA SQL Statements) to retreive a list of all PUBLIC
> tables, columns and their descriptions.

Look at the INFORMATION_SCHEMA schema.

--
Craig Ringer