Re: proposal psql \gdesc

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2017-05-09T18:37:16Z
Lists: pgsql-hackers
Hello Pavel,

> [...] it is little bit worse. I cannot to distinguish between 
> SELECT\gdesc and TRUNCATE xxx\gdesc . All are valid commands and produce 
> empty result, so result of \gdesc command should be empty result too.
>
> postgres=# truncate table xx\gdesc
> ┌──────┬──────┐
> │ Name │ Type │
> ╞══════╪══════╡
> └──────┴──────┘
> (0 rows)

Hmmm. At least it is better than the previous error.

What about detecting the empty result (eg PQntuples()==0?) and writing 
"Empty result" instead of the strange looking empty table above? That 
would just mean skipping the PrintQueryResult call in this case?

-- 
Fabien.

Commits

  1. Add \gdesc psql command.