等同于“描述表".在PgAdmin3中 [英] Equivalent of "describe table" in PgAdmin3

查看:90
本文介绍了等同于“描述表".在PgAdmin3中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题被回答:

众所周知,PostgreSQL不支持describe tabledescribe view.正如从Google可能发现的那样,PostgreSQL使用\d+代替.

As many of us know, PostgreSQL does not support describe table or describe view. As one might find from google, PostgreSQL uses \d+ instead.

但是,如果使用PgAdmin访问PostgreSQL(我实际上是在使用PgAdmin3),则\d+不起作用.而是做什么?

However, if one accesses PostgreSQL using PgAdmin (I am actually using PgAdmin3) then \d+ does not work. What does one do instead?

在使用PgAdmin3中的查询工具时,我想到了这个问题.我有一个恩,du!"当我想到查看PgAdmin3的主窗口以及该窗口左侧的树时.在

I thought about this question when playing with the query tool in PgAdmin3. I had a "well, duh!" moment when I thought to look at the home window of PgAdmin3, and at the tree on the left side of that window. Under

<servername>
-> <databasename>
-> Schemas
-> <schemaname>
-> Tables

是我的表格列表, 然后点击表格名称,向我显示文字 很像\d+会给我看的东西.

was a list of my tables, and clicking on the table name showed me text very much like what \d+ would have showed me.

因此,对于没有立即发现此问题的其他人,这是一个答案.

So for the benefit of anyone else who did not discover this right away, here is an answer.

推荐答案

PostgreSQL还支持标准的SQL信息模式来检索数据库中对象的详细信息.

PostgreSQL also supports the standard SQL information schema to retrieve details of objects in the database.

即要获取列信息,可以查询information_schema.columns视图:

i.e. to get column information you can query the information_schema.columns view:

SELECT *
FROM information_schema.columns
WHERE table_name = '????';

此处中查看有关信息架构的PostgreSQL特定详细信息.

Check here for PostgreSQL specific details on the information schema.

这篇关于等同于“描述表".在PgAdmin3中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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