Describe Table

From: <danap(at)dandymadeproductions(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Describe Table
Date: 2007-12-17 16:56:32
Message-ID: 20071217165211.E18222E3202@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I've reviewed much of the documentation and the forums,
but unable to seem to find a easy way to obtain the same
thing as the 'psql \d table' through sql. I know I can create
through collecting info on table, but seems there must be an
easier way. I desire to create a standard type SQL dump
syntax.

ex.
DROP TABLE IF EXISTS postgresqltypes;
CREATE TABLE postgresqltypes (

-- Table id and creation data entries.

data_type_id serial NOT NULL,
smallInt_type smallint DEFAULT NULL,
int_type integer DEFAULT NULL,
bigInt_type bigint DEFAULT NULL,
decimal_type decimal(16,2) DEFAULT NULL,
numeric_type numeric(10,2) DEFAULT NULL,
real_type real DEFAULT NULL,
doublePrecision_type double precision DEFAULT NULL,
serial_type serial,
bigSerial_type bigserial,
PRIMARY KEY (data_type_id));

dana.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo De León 2007-12-17 17:27:34 Re: passing a multiple join to a function?
Previous Message Louis-David Mitterrand 2007-12-17 13:06:29 passing a multiple join to a function?