There is a shortcut for SELECT * FROM
in standard SQL, so you can use it in psql:
TABLE tablename;
This syntax shorthand can only be used with a limited range of clauses. 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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…