gpt4 book ai didi

Postgresql,获取表定义,pg_get_tabledef

转载 作者:行者123 更新时间:2023-12-04 07:01:00 35 4
gpt4 key购买 nike

你知道 postgresql 8.4 中的 pg_get_tabledef 函数发生了什么吗?我确定我一直在将它与以前版本的 postgresql 一起使用?

我需要为数据库中的现有表获取 sql 'create table' 语法和索引,默认值等等......也许他们用别的东西代替了它?

最佳答案

看看\dt命令在 http://www.postgresql.org/docs/8.4/interactive/app-psql.html

您可能希望使用 -E 参数

-E
--echo-hidden
Echo the actual queries generated by \d and other backslash commands.You can use this to study psql's internal operations. This is equivalent to setting the variable ECHO_HIDDEN from within psql.
启动终端

编辑和顺便说一句:

http://markmail.org/message/3obwktwfnxfwspxg?q=pg_get_tabledef+type:announcements :

== PostgreSQL Weekly News - March 31 2007 ==
[...}
Bruce Momjian committed:
[...]
- Remove TODO due to lack of interest: "Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(), pg_get_tabledef(), pg_get_domaindef(), pg_get_functiondef()."

关于Postgresql,获取表定义,pg_get_tabledef,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1846542/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com