There are many useful shortcuts in psql console like \d
or \l
.
I wondering is there one for SELECT * FROM table_name
?
I use this query often for learning purposes so it would be quite helpful not to have to write select * from ...
all the time.
Press Ctrl+A on your keyboard to select all text in the document.
Press SHIFT+TAB to select the object that you want. Press SHIFT+F10 for the shortcut menu.
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
andFOR
locking clauses can be used withTABLE
; theWHERE
clause and any form of aggregation cannot be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With