Re: PostgreSQL counterpart to DBMS_METADATA?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL counterpart to DBMS_METADATA?
Дата
Msg-id 15576.1326812603@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PostgreSQL counterpart to DBMS_METADATA?  (Michael Tefft <mjtefft@hotmail.com>)
Список pgsql-general
Michael Tefft <mjtefft@hotmail.com> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: [GENERAL] RE: [GENERAL] PostgreSQL counterpart to DBMS_METADATA?‏
Следующее
От: Jeroen van Dongen
Дата:
Сообщение: Possible bug in PL/Python?