SELECT * FROM 有快捷方式吗?

Is there a shortcut for SELECT * FROM?

psql 控制台中有许多有用的快捷方式,例如 \d\l
我想知道 SELECT * FROM table_name 有没有?
我经常出于学习目的使用此查询,因此不必一直写 select * from ... 会很有帮助。

标准SQL中有SELECT * FROM的快捷方式,所以你可以在psql中使用它:

TABLE tablename;

此语法 shorthand 只能用于有限范围的子句。 The manual:

It can be used as a top-level command or as a space-saving syntax variant in parts of complex queries. Only the WITH, UNION, INTERSECT, EXCEPT, ORDER BY, LIMIT, OFFSET, FETCH and FOR locking clauses can be used with TABLE; the WHERE clause and any form of aggregation cannot be used.