Display or show tables in a PostgreSQL/PgSQL database
From the PostgreSQL psql monitor, use the following command to view the tables in the current database:
\dt
From the PostgreSQL psql monitor, use the following command to view the tables in the current database:
\dt
RSS feed for comments on this post. TrackBack URL
noMan said on May 24, 2010
very old post :(
Marek Pe said on August 13, 2010
You can receive column comments in SQL:
SELECT a.attname AS column, d.description AS COMMENT
FROM pg_class c
JOIN pg_description d ON c.oid=d.objoid
JOIN pg_attribute a ON c.oid = a.attrelid
WHERE c.relname=’monitors’
AND a.attnum = d.objsubid
Joe said on September 9, 2010
So what? Still worked for me…
Guest said on December 8, 2010
select
ordinal_position,
column_name,
data_type,
is_nullable,
description.description as comment
from
information_schema.columns columns
left join pg_class class on (columns.table_name = class.relname)
left join pg_description description on (class.oid = description.objoid)
left join pg_attribute attrib on (class.oid = attrib.attrelid and columns.column_name = attrib.attname and attrib.attnum = description.objsubid)
where
table_name=’{$tableName}’
group by
ordinal_position, column_name, data_type, is_nullable, description.description
runa said on July 13, 2011
Thanks :) It worked
Taller de creación literaria cinco letras said on September 14, 2011
not working :s
Taller de creación literaria cinco letras said on September 14, 2011
Never mind, I did´t selected the db