我想在我的PostgreSQL安装中列出liferay
数据库中的所有表格。我怎么做?Psql列出所有表格
我想在liferay
数据库中执行SELECT * FROM applications;
。 applications
是我liferay分贝中的表格。这是如何完成的?
这里是我的所有数据库的列表:
postgres=# \list
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
liferay | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =Tc/postgres +
| | | | | postgres=CTc/postgres+
| | | | | liferay=CTc/postgres
lportal | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
postgres=#
哇!非常感谢你的顺便说一句。这非常有价值。 –
'information_schema.tables'包含某些原因的视图。 (无论如何,在PostgreSQL 9.2中。) – jpmc26
@ jpmc26是的,'table_type ='VIEW'',所以它们很容易排除。一般来说,SQL尽可能地尝试将表视为与表相同。 –