Skip site navigation (1) Skip section navigation (2)

\d <table> command

From: Mark Jewiss <Mark(dot)Jewiss(at)knowledge(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: \d <table> command
Date: 1999-09-27 13:15:43
Message-ID: Pine.BSO.4.10.9909271412510.4204-100000@office.knowledge.com (view raw or flat)
Thread:
Lists: pgsql-general
Hello,

I want to be able to build up information about the different tables held
in a database for a small diagnostic tool that I'm writing.

I need to see the name of each column in the table, the column data type
and size, and if nulls are allowed - essentially what is produced by the
'\d <tablename>' command.

Does anyone know the SQL query to use on the system tables to produce that
result? I've started to go through them now, and was expecting to find
something along the lines of 'pg_columns', but no such luck. :(

Regards,

Mark.
-- 
Mark Jewiss
Knowledge Matters Limited
http://www.knowledge.com


Responses

pgsql-general by date

Next:From: Imreet SinghDate: 1999-09-27 13:23:09
Subject: Trouble with Innstalling PostGreSQL 6.5.2 on Win NT
Previous:From: Otavio ExelDate: 1999-09-27 12:38:56
Subject: libpq on win32 & postgresql on linux

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group