On 2/12/22 19:11, Andreas 'ads' Scherbaum wrote:
The complaint is not about complex queries, or CTEs, or Joins. This is
about simple queries where a user wants to discover - surf - the database
and look into specific tables, but exclude certain columns. More
specifically,
this is when the user types in interactive queries.
There is already something very similar to what you are describing:
https://www.psycopg.org/docs/cursor.html
Each cursor has its description, which consists of the column
descriptions. Basically, it's like doing \d on a cursor. Unfortunately,
it's not interactive, one has to do some pythong programming in order do
to that. Unfortunately, it is not possible to just "describe the
cursor", the description becomes available after the "execute" call.
Hopefully, I understood you correctly.
--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com