Search Postgresql Archives

Re: PostgreSQL counterpart to DBMS_METADATA?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Tefft <mjtefft@xxxxxxxxxxx> writes:
> I would like to extract the DDL to create a given object (tables, primarily) from the catalog. Is there an interface, query, etc. that will do this? I'd rather not craft the DDL myself.

DDL isn't actually stored in the catalogs anywhere; it has to be
reconstructed.  The only complete solution to that problem is embodied
in pg_dump.  Hence the short answer is "extract what you need from
pg_dump output".  Depending on exactly what you need, you might be able
to get pg_dump to emit only the object definition(s) you want in the
first place.  Another possibility that wouldn't involve editing a large
dump file is to dump to an archive file and then use pg_restore's -l
and -L options to obtain a customized selective restore script.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux