Generate DDL programmatically on Postgresql

后端 未结 6 1829
陌清茗
陌清茗 2020-12-05 17:34

How can I generate the DDL of a table programmatically on Postgresql? Is there a system query or command to do it? Googling the issue returned no pointers.

6条回答
  •  隐瞒了意图╮
    2020-12-05 18:15

    You can use the pg_dump command to dump the contents of the database (both schema and data). The --schema-only switch will dump only the DDL for your table(s).

提交回复
热议问题