Re: [HACKERS] proposal psql \gdesc - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] proposal psql \gdesc
Date
Msg-id alpine.DEB.2.20.1705092031490.8943@lancre
Whole thread Raw
In response to Re: [HACKERS] proposal psql \gdesc  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: [HACKERS] proposal psql \gdesc
List 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.

pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: [HACKERS] COMPRESS VALUES feature request
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Logical replication ApplyContext bloat