在Postgresql上以编程方式生成DDL [英] Generate DDL programmatically on Postgresql

查看:125
本文介绍了在Postgresql上以编程方式生成DDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Postgresql上以编程方式生成表的DDL?是否有系统查询或命令来执行此操作?谷歌搜索问题不返回任何指针。

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.

推荐答案

答案是检查pg_dump的源代码并遵循其生成的开关。 DDL。在代码中的某个地方,有许多查询用于检索用于生成DDL的元数据。

The answer is to check the source code for pg_dump and follow the switches it uses to generate the DDL. Somewhere inside the code there's a number of queries used to retrieve the metadata used to generate the DDL.

这篇关于在Postgresql上以编程方式生成DDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆