Need help accessing TABLES, COLUMNS, DESCRIPTIONS

From: "Robert Paresi" <firstname(at)lastname(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Need help accessing TABLES, COLUMNS, DESCRIPTIONS
Date: 2011-01-21 14:45:44
Message-ID: ihc66n$oap$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2011-01-21 14:55:35 Re: Copying databases with extensions - pg_dump question
Previous Message Ivan Voras 2011-01-21 14:17:59 Re: Copying databases with extensions - pg_dump question