I'm using PostgreSQL server on my Windows.
I have created table user(id, name, age) and inserted some data there.
When I'm trying to retrieve that data via SELECT ALL FROM user
I'm getting only the rows count and just plain nothingness.
How it looks like in psql CLI:
...and I'm also receiving empty object array as query result in my nodejs app:
Postgres supports SELECT ALL
as a synonym for SELECT
-- as a two words syntax parallel to SELECT DISTINCT
. The ALL
does nothing.
In addition, Postgres -- unlike other databases -- allows a SELECT
to select no columns.
So:
SELECT ALL
FROM user;
Selects all the rows from user
but no columns. In general, you would instead write:
SELECT *
FROM user;
to see the contents of the rows. If you want to be verbose, yo could use:
SELECT ALL *
FROM user;
But that is used somewhere close to never in practice.