From: | Jesse <google(at)jessehersch(dot)fastmail(dot)fm> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Dynamically generating DDL for postgresql object |
Date: | 2007-06-16 01:22:23 |
Message-ID: | 1181956943.547862.291470@q19g2000prn.googlegroups.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You can use pg_dump.exe to generate DDL in postgre.
see: http://www.postgresql.org/docs/8.2/interactive/app-pgdump.html
also you might check out the app in my sig for a tool that generates
full reports/documentation about any pg database.
hth, Jesse
-----------------------
http://www.elsasoft.org
On Jun 15, 11:31 am, markaso(dot)(dot)(dot)(at)hotmail(dot)com ("Mark Soper") wrote:
> I'd like to dynamically generate a SQL script that pulls together complete
> DDL (CREATE, ALTER, etc.) for specific objects (especially constraints) in
> my PostgreSQL 8 database. I want to use this for our development project's
> schema migration process, which involves dumping the data, making schema
> changes, recreating the database, temporarily removing constraints,
> restoring the data, and re-applying the constraints (this last step requires
> the dynamic DDL described above).
>
> I've noticed that pgAdmin's "DDL Report" feature can retrieve this DDL for
> many types of objects - not sure how much work it has to do to build the SQL
> it's displaying here. But I haven't seen anything about getting this
> directly from the database using SQL , psql, etc. I've only seen reference
> to this as a proposed project on the PostgreSQL
> <http://www.postgresql.org/developer/summerofcode.html> Google SoC page
>
> Anyone know how to get object DDL SQL through a script? Ideas on
> alternative approaches would also be appreciated.
>
> Thanks,
>
> Mark
From | Date | Subject | |
---|---|---|---|
Next Message | John DeSoi | 2007-06-16 01:50:39 | Re: Dynamically generating DDL for postgresql object |
Previous Message | Alfred Zhao | 2007-06-15 23:47:10 | Which meta table contain the functions |