Re: how do I get table DDL from psql (not from pg_dump) - Mailing list pgsql-sql

From Frank Bax
Subject Re: how do I get table DDL from psql (not from pg_dump)
Date
Msg-id 47C58070.2090809@sympatico.ca
Whole thread Raw
In response to how do I get table DDL from psql (not from pg_dump)  ("Sofer, Yuval" <Yuval_Sofer@bmc.com>)
List pgsql-sql
Sofer, Yuval wrote:
> I need to extract table DDL (create script) from database connection 
> (using sql, by retrieving system table info or by activating some pg 
> function)


This command should output the SQL you need...

echo '\d tablename' | psql -E




pgsql-sql by date:

Previous
From: Gregory Stark
Date:
Subject: Re: REFERENCES and INHERITS restrictions?
Next
From: Steve Crawford
Date:
Subject: Re: SQL standards in Mysql