|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
system catalogue queries
Hi all,
I have a good understanding of sql, but no syntactical knowledge specific to postgresql. I have created a table: CREATE TABLE test1 ( test_id DECIMAL(8), name CHAR VARYING(40), PRIMARY KEY(test_id) ); Now, suppose I want to check what the attributes of this table are. Is there an easy way to 'describe' the table? From what I can find it seems like you can query pg_class and pg_attribute, but it seems to me that there must be a quicker way of obtaining this information. Thanks in advance |
|
#2
|
|||
|
|||
|
From the 'psql' interface, enter '\d [tablename]'. If you just enter '\d', you get a summary description of the whole database. '\?' for more details.
__________________
The real n-tier system: FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL Amazon wishlist -- rycamor (at) gmail.com |
|
#3
|
|||
|
|||
|
Hey, thanks Rycamor.
That works fine. |
![]() |
| Viewing: Dev Shed Forums > Databases > PostgreSQL Help > system catalogue queries |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|