Re: how do I get table DDL from psql (not from pg_dump)

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: how do I get table DDL from psql (not from pg_dump)
Date: 2008-02-27 15:23:28
Message-ID: 47C58070.2090809@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andrew Sullivan 2008-02-27 15:50:08 Re: how do I get table DDL from psql (not from pg_dump)
Previous Message A. Kretschmer 2008-02-27 12:19:11 Re: how do I get table DDL from psql (not from pg_dump)

Browse pgsql-sql by date

  From Date Subject
Next Message Lew 2008-02-27 16:57:49 Re: how do I get table DDL from psql (not from pg_dump)
Previous Message Gregory Stark 2008-02-27 14:04:43 Re: REFERENCES and INHERITS restrictions?