Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-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

pgsql-admin by date

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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group