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

From Pavel Stehule
Subject Re: [HACKERS] proposal: psql command \graw
Date
Msg-id CAFj8pRBmB-++d8Xi=i=moLhj5q=6Tg0N62ogPhE0OeUaK72GBw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] proposal: psql command \graw  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] proposal: psql command \graw  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers


2017-08-24 8:53 GMT+02:00 Fabien COELHO <coelho@cri.ensmp.fr>:

"column_header" is somehow redundant with "tuples_only". Use the
existing one instead of adding a new one?

It is different - a result of tuples_only is just tuples - not column
names, not title, footer. I needed new special flag for enhancing
tuples_only to print column names

I do not understand. If you keep the special print_raw function, it can use tuples_only as true for without column names, and false for with column names?

yes - in this case you have true.
 


More generally, ISTM that the same effect could be achieved without
adding a new print function, but by setting more options (separator,
...) and calling an existing print function. If so, I think it would
reduce the code size.

Maybe, maybe not. removing PRINT_RAW you need to enhance PRINT_UNALIGNED to
use one shot parameters and you have to teach it to print column names in
tuples_only mode. The code's length will be same. The form of this patch is
not final.

Hmmm. Ok. It depends on the change implication on the print unaligned function.

It is open - I'll wait to winter commitfest for some other ideas, tests, comments - it is topic for PostgreSQL 11, and then there are a time for discussion

Now, I'll be happy if some other people will test it with larger set of applications and send me a feedback.

Regards

Pavel
 


--
Fabien.

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] pgbench: Skipping the creating primary keys after initialization
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Quorum commit for multiple synchronous replication.