pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: danap@dandymadeproductions.com
To: pgsql-sql@postgresql.org
Subject: Describe Table
Date: Mon, 17 Dec 2007 08:56:32 -0800
Message-ID: <20071217165211.E18222E3202@postgresql.org> (raw)

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. 






view thread (6+ messages)  latest in thread

Message-ID: <20071217165211.E18222E3202@postgresql.org>
Permalink:  ../20071217165211.E18222E3202@postgresql.org/
Also on:    postgresql.org/message-id/20071217165211.E18222E3202@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: danap@dandymadeproductions.com
  Subject: Re: Describe Table
  In-Reply-To: <20071217165211.E18222E3202@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox