From: | Jim Nasby <decibel(at)decibel(dot)org> |
---|---|
To: | Fei Liu <fei(dot)liu(at)aepnetworks(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: how to view the content of schema pg_catalog? |
Date: | 2007-05-09 23:38:30 |
Message-ID: | 405BC338-B68C-41FE-86E0-BFC189AA3827@decibel.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On May 8, 2007, at 1:33 PM, Fei Liu wrote:
> Jim C. Nasby wrote:
>> Please include the list in your replies so that others can learn.
>>
>> On Mon, May 07, 2007 at 09:35:10AM -0400, Fei Liu wrote:
>>
>>> Jim Nasby wrote:
>>>
>>>> On Apr 25, 2007, at 4:37 PM, Fei Liu wrote:
>>>>
>>>>> I couldn't find anything in the postgresql manual as how to
>>>>> view its content. SELECT does not seem to work.
>>>>>
>>>> What's the exact command and error message?
>>>>
>>> netilla=# \dn
>>> List of schemas
>>> Name | Owner
>>> --------------------+----------
>>> information_schema | postgres
>>> pg_catalog | postgres
>>> pg_toast | postgres
>>> public | postgres
>>> (4 rows)
>>>
>>> netilla=# select * from pg_catalog;
>>> ERROR: relation "pg_catalog" does not exist
>>>
>>
>> That would be because pg_catalog is a schema; you can't select
>> from it.
>> If you want to see what's in there, use \dS.
>>
> Thanks, \dS works ( it does not take an argument). Is there a
> programtic way for me to see this from either Perl or C? Does pgsql
> export APIs to check schema content?
Sure, read about the structure of the catalog tables in the docs and
query them directly. Starting psql with the -E option and running
various \d commands might prove enlightening as well. You can also
take a look at the definition of stuff in information_schema or the
newsysviews project on pgFoundry.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Nasby | 2007-05-09 23:39:59 | Re: Disk and shared buffer cache use |
Previous Message | Tom Lane | 2007-05-09 15:28:18 | Re: Fw: Count rows group by time intervals |