用于查看表结构的语法 [英] syntax to view the structure of a table

查看:216
本文介绍了用于查看表结构的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在postgre中我想查看表的结构。请告诉我是否有任何查询检索表的结构。请帮助我。



提前感谢

priyan ....

hi

In postgre I want to view the structure of a table . pls tell me is there any query for retrieving the structure of a table. pls help me.


thanks in advance
priyan....

推荐答案


hi


在postgre中我想查看表的结构。请告诉我是否有任何查询检索表的结构。请帮助我。



提前谢谢

priyan ....
hi

In postgre I want to view the structure of a table . pls tell me is there any query for retrieving the structure of a table. pls help me.


thanks in advance
priyan....




如果您在linux中工作,那么您只需给出\d后跟表名



If you are working in linux then u just give \d followed with the table name


这将适用于任何支持的操作系统,Linux,Windows等

打开psql会话并输入\d或\d +


摘自手册:
This will work on any supported OS, Linux, Windows, etc
Open the psql session and type \d or \d+

Excerpt from the manual:


\ d [模式]

\d + [模式]


对于每个关系(表,视图,索引或序列) )匹配模式,显示所有列,它们的类型,表空间(如果不是默认值)和任何特殊属性,如NOT NULL或默认值,如果有的话。还显示了关联的索引,约束,规则和触发器,如果​​关系是视图,则视图定义也是如此。 (匹配模式定义如下。)


命令格式\d +是相同的,除了显示更多信息:与表的列相关的任何注释都是显示,表中是否存在OID。


注意:如果没有使用模式参数使用\d,则它等效于\dtvs,它将显示一个列表所有表格,视图和序列。这纯粹是一种便利措施。

\d [ pattern ]
\d+ [ pattern ]

For each relation (table, view, index, or sequence) matching the pattern, show all columns, their types, the tablespace (if not the default) and any special attributes such as NOT NULL or defaults, if any. Associated indexes, constraints, rules, and triggers are also shown, as is the view definition if the relation is a view. ("Matching the pattern" is defined below.)

The command form \d+ is identical, except that more information is displayed: any comments associated with the columns of the table are shown, as is the presence of OIDs in the table.

Note: If \d is used without a pattern argument, it is equivalent to \dtvs which will show a list of all tables, views, and sequences. This is purely a convenience measure.



参见 psql手册页获取更多信息



这适用于任何支持的操作系统,Linux,Windows等等

打开psql会话并输入\d或\d +


摘自手册:


请参阅 psql手册页更多信息
This will work on any supported OS, Linux, Windows, etc
Open the psql session and type \d or \d+

Excerpt from the manual:

See the psql man page for more information



\ [[pattern]无效。

\ d [memberphoto]是我的命令是否正确。

memberphoto是我的表名,请帮帮我.........


\d [pattern] is not working.
\d[memberphoto] is my command is correct or not.
memberphoto is my tablename please help me.........


这篇关于用于查看表结构的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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