[SQL] Describe Table

2007-12-17 Thread danap
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. 




---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [SQL] Describe Table

2007-12-17 Thread danap
Thanks guys,
That pretty much answers my questions. No there is not
an easy way. While the access to a lot of internals to the
postgresql database can be advantages it is exactly the
kind of thing to break generic code anytime something
changes. I think I'll take the harder approach and stick
with the standard defined interfaces in java.sql. Did I
read this in the manual somewhere? :)

MySQLView Project Manager
Dana Proctor



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match